This assignment is intended to see if youve learned the basic concepts talked about thus far in the lectures.

You will be required to take pre-existing code and augment it download the cpp attached to this assignment, and copy paste the code, or create a new blank project and import the cpp file.

Program

Use the code provided in GuessGame_skel.cpp and augment it.

The application is a fun and exciting number guessing game. (Im thinking of a number between 1-x, guess it!)

Your job is to make the application evaluate the users guess and provide output.

  • The application must provide 3 different messages, depending on the value of the users guess and the random number:
    • The guess was too low (guess is less than roll)
    • The guess was too high (guess is greater than roll)
    • You guessed correctly, congratulations! (guess is roll)
  • You can change the wording of the messages, but they must make sense
  • The application must ensure the user enters a valid guess
    • Guess is less than or equal to the maximum
    • Guess is greater or equal to 1
    • Provide a message: You guessed with an invalid number, please ensure your guess is between 1 and [MAX_ROLL] the value of the constant MAX_ROLL
    • Repeat the question until they select a valid guess.

Sample Output:

Hello! Let's play a dice game. Let me do the first roll for you.
In this roll, you got: 4
What's your guess for the next roll? Enter an integer between 1 and 6: 2
In this roll, you got: 4
The guess was too low
Enter 1 to exit or any other integer to continue rolling 1
Hello! Let's play a dice game. Let me do the first roll for you.
In this roll, you got: 3
What's your guess for the next roll? Enter an integer between 1 and 6: 7
You guessed with an invalid number, please ensure your guess is between 1 and 6
What's your guess for the next roll? Enter an integer between 1 and 6: 0
You guessed with an invalid number, please ensure your guess is between 1 and 6
What's your guess for the next roll? Enter an integer between 1 and 6: 3
In this roll, you got: 5
The guess was too low
Enter 1 to exit or any other integer to continue rolling 2
What's your guess for the next roll? Enter an integer between 1 and 6: 3
In this roll, you got: 6
The guess was too low
Enter 1 to exit or any other integer to continue rolling 1
Sorry to see you go. Have a wonderful day!
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.