Question: The program is a bit tedious because the answer is hard-coded into the program. Make a version where the user can play repeatedly (without stopping
The program is a bit tedious because the answer is hard-coded into the program. Make a version where the user can play repeatedly (without stopping and restarting the program) and each game has a new set of four digits. You can get four random digits by calling the random number generator randint(10) from std_lib_facilities.h four times. You will note that if you run that program repeatedly, it will pick the same sequence of four digits each time you start the program. To avoid that, ask the user to enter a number (any number) and call seed_randint(n), also from std_lib_ facilities.h, where n is the number the user entered before calling randint(10). Such an n is called a seed, and different seeds give different sequences of random numbers.
Step by Step Solution
3.42 Rating (152 Votes )
There are 3 Steps involved in it
include include stdlibfacilitiesh ... View full answer
Get step-by-step solutions from verified subject matter experts
