you will edit a guessing game program that is already written the computer generates a number between 1 and 20 the user must guess the number.C Programming

Instructions
For this assignment, you will edit a guessing game program that is already written. The computer generates a number between 1 and 20. The user must guess the number. Download and run the attached program. Then, familiarize yourself with the code.

5 points: Please add your answers to the following questions as comments in your file:
   1) Please fully explain line 76: srand(seed);
   2) Please fully explain line 77: randomNumber = rand() % 20 + 1;
   3) Please fully explain line 79: while (guessCounter < GUESSES && guess != randomNumber) 
   4) Please fully explain line 82: while ((1 != scanf("%d", &guess)) || guess < 1 || guess > 20) {
   5) Why is it important to include the stdlib.h C library?

5 points: The program is predictable because the user is entering their own seed for rand(). This follows the logic used in r_drive1.c. Change the code so that rand() is seeded with using the current computer time. Follow the logic in the manydice.c program.

5 points: Edit the program so that the user can select the number of tries they are given.

5 points: Edit the program so that the user can select the range for the numbers to be guessed. Make sure you also edit the prompt to the user for entering their guess.

Edit the program so that the score is kept between function calls. Here is an example of the output you should create: 

Assuming that the previous score was Computer: 1, Human: 2...

**********************

Welcome to the guessing game!
I am thinking of a number between 1 and 20.
Enter your guess or press 0 to stop.
10
The number is higher.
Enter your guess or press 0 to stop.
15
The number is higher.
Enter your guess or press 0 to stop.
18

You got it! The number was: 18
The current score is Computer: 1  Human: 3

***************************
1. Guessing Game
2. 
3. 
....

Attachments:

Instructions Files

C Programming Experts

expert
Arapera Billing
C Programming

89 Answers

expert
Simon M.
C Programming

44 Answers

View More Experts
Disclaimer

The ready solutions purchased from Library are already used solutions. Please do not submit them directly as it may lead to plagiarism. Once paid, the solution file download link will be sent to your provided email. Please either use them for learning purpose or re-write them in your own language. In case if you haven't get the email, do let us know via chat support.

Get Free Quote!

270 Experts Online