Question: C++ Exercise 1 Write a program that asks the user to enter the seed for a random number generator. Then the program uses this seed

C++
 C++ Exercise 1 Write a program that asks the user to

Exercise 1 Write a program that asks the user to enter the seed for a random number generator. Then the program uses this seed to roll a dice and hence generates two integers corresponding to the faces of each dice. If their sum is odd, the user has two tries to guess the sum. The program gives the user a hint after the first try. Otherwise, the user has three tries to guess the sum. Sample run 1 Enter the seed of the random number generator: 15 The sum is odd, you have two tries to guess the sum. Enter first guess: 7 Incorrect. Hint: Sum is larger than 7 Try again: 9 Incorrect. The sum is 5+6 11 Sample run 2: Enter the seed of the random number generator: 52 The sum is even, you have three tries to guess the sum. Enter first guess: 6 Incorrect. Try again: 10 Incorrect. Try again: 8 Congratulations, sum of 5+3 is 8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!