This must be done in C++. Please include meaningful comments. In all my attempts, my program generated
Question:
This must be done in C++. Please include meaningful comments. In all my attempts, my program generated the same integers several times, ex "4 4 4 4" instead of random numbers. Please include validation rules for the program to exclude negative and decimal numbers. Thank you very much!
Design and implement an ADT for a one-person guessing game that chooses n random integers in the range of 1 to m and asks the user to guess them. The same integer might be chosen more than once. For example, the game might choose the following four integers that range from 1 to 10: 4, 6, 1, 6.
The following interactions could occur between the user and the game, after the user has specified the integers m and n:
Enter the Number of Integers (n): 4
Enter the Number of Each Integers from 1 to (m): 10
Enter your guesses for the 4 integers in the range from 1 to 10 that have been selected: 1 2 3 4
2 of your guesses are correct. Guess again.
Enter your guesses for the 4 integers in the range from 1 to 10 that have been selected: 2 4 6 8
2 of your guesses are correct. Guess again.
Enter your guesses for the 4 integers in the range from 1 to 10 that have been selected: 1 4 6 6
You are correct! Play again? No
Good-bye!
Please be sure to implement the problem using the following .h and .cpp files:
- Driver.cpp -- Contains the main() function and some other functions.
- Game.h -- Contains the header information for the game.
- Game.cpp -- Contains the implementation for the game.
Accounting Information Systems
ISBN: 9780132871938
11th Edition
Authors: George H. Bodnar, William S. Hopwood