Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for C code Description:For this project you are tasked with creating a guessing game. The computer will generate a random number between 1

This is for C code

Description: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 number 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. 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 youturn in the compiled program (executable) instead of the source code, you may at my discretion beallowed to resubmit your source code for a -40 point deduction. You mustunderstand 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 thecaller 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 shouldalso 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 eachUse of the exit() statement: -10 pointsMixing local declarations and local statements in functions: -10 pointsMissing return statements in all functions: -5 points each10.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 havefunction descriptions as shown in the same example. -5 each max -15 11.Your user defined functions must use a function prototype in the global declarationsarea and have the function definitions under the main function with comments inyour 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 underscorebetween the parts of a descriptive name for the function. -5 each max -15Variables: start with lower case and use camel case or an underscore toseparate 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database Technology

Authors: Suad Alagic

1st Edition

354096276X, 978-3540962762

More Books

Students also viewed these Databases questions

Question

Question May I set up a Keogh plan in addition to an IRA?

Answered: 1 week ago