Question: For this project you are tasked with creating a guessing game. The computer will generate a random number between 1 and 20 and the user
For this project you are tasked with creating a guessing game. The computer will generate a random number between 1 and 20 and the user will be given 5 guesses to guess the number that the computer has chosen. After each guess, the program will inform the user if the nu

mber they entered was larger than the, less than, or equal to the random number. If it is equal then no other guesses should be made. If after 5 tries the user has not guessed the correct answer then the game should notify the user that they have lost and the game should end.

I want it in c++ programming language(printf) ,,,also these are the requirements so please take them in consideration:
Program Requirements: Your program must make use of the following. The points do not equal 100 points as there are many items that must be included in the program. Some omissions and errors are more egregious than others. 1.Your source code must compile for me. -25 points if I have to fix it to compile. Test your program on the server before you turn it in. If you turn in the compiled program (executable) instead of the source code, you may at my discretion be allowed to resubmit your source code for a -40 point deduction. You must understand these concepts and how to use these tools as a part of this course. This is a part of the assignment.
2.If your program does not make use of selection to produce the correct outcomes or operate per the description and requirements you will lose points. -40 for no or incorrect logic. This includes not ending when it should, for instance still asking for more inputs even if the user has won the game
.3.Your program must use a function to provide instructions to the user and allow them the choice to exit the game. The function should use a return value to the caller to determine if the user has selected to quit the game or not. You may use a return value or a pointer, but the function should provide a value back to the caller to be used to determine to quit or not. -10 for no use of this function or an incomplete function.
4.Your function must use a user defined function to generate a random number and return it to the calling function. Your function must take as parameters the range and offset desired. Your function header should use value variables and not defined constants. The calling function would sue the defined constants. -10 for no or incorrect use of this function.
5.Your program must use a user defined function to get the users guessed value and return it to the calling function using pointers. -10 for no or incorrect use of this function.
6.Your program must use a user defined function to print the unsuccessful message. This function should print out the users value as a part of its message. It should also determine if the value was lower or higher than the computers choice. -10 for no or incorrect use of this function.
7.Your program must use a user defined function to print the successful message. This function should print out the users value as a part of its message. -10 for no or incorrect use of this function.
8.Your program must use a user defined function to print the apology(sorry)message. This function should print out the users value as a part of its message as well as the computers chosen value. -10 for no or incorrect use of this function.
9.Your program should not make use of or contain the following items:Global variables other than a defined constant: -10 points each Use of the exit() statement: -10 points Mixing local declarations and local statements in functions: -10 points Missing return statements in all functions: -5 points each
10.Your program should contain a program description as a block comment at the top of your code as shown in the module 2 example. Your functions should also have function descriptions as shown in the same example. -5 each max -15
11.Your user defined functions must use a function prototype in the global declarations area and have the function definitions under the main function with comments in your other functions as needed area of your source code. -15
12.Your variable names and function names must follow the standard naming conventions. Functions: Start with capitals and use either camel case or an underscore between the parts of a descriptive name for the function. -5 each max -15Variables: start with lower case and use camel case or an underscore to separate the descriptive name pieces of the variable. -5 each max -15All Constants should be all uppercase. -5 each max -15
13.Your program must be neat and your code should be tabbed in from the left margin. All nested blocks of code should be tabbed as well. -5
14.The seed function srand() should only be called once in main. -5
... Sample Outputs: NOTE: You do not have to duplicate my exact sample. Example of quitting. Would you like to play the guessing game? Enter in a 'y' for yes and a 'n' to quit.n You have chosen to quit or entered an invalid choice. Example of Winning Would you like to play the guessing game? Enter in a 'y' for yes and a 'n' to quit.y I am thinking of a number from 1 to 20. Can you guess what it is? 3 Your guess of 3 is too low. Try again. Can you guess what it is? 6 Your guess of 6 is too low. Try again. Can you guess what it is? 8 Your guess of 8 is too low. Try again. Can you guess what it is? 9 Your guess of 9 is too low. Try again. Can you guess what it is? 12 Congratulations! You did it! Example of Losing Nould you like to play the guessing game? Enter in a 'y' for yes and a 'n' to quit.y I am thinking of a number from 1 to 20. Can you guess what it is? 2 Your guess of 2 is too low. Try again. Can you guess what it is? 5 Your guess of 5 is too low. Try again. Can you guess what it is? 9 Your guess of 9 is too low. Try again. Can you guess what it is? 3 Your guess of 3 is too low. Try again. Can you guess what it is? 4 Your guess of 4 is too low. Sorry. The correct number was: 10 You should have guessed it by now. Better luck next time
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
