Must create an interactive program (in C language) in which the computer generates a random number between 1 and 15. The user is presented with a guessing game and must enter their guess as to which number the computer is "thinking of" (the randomly generated number between 1 and 15). The user is limited to five guesses. If the user guesses the correct number within the five guess limit, they win. If the user does not guess correctly within the five guess limit, they lose the game. Following each user input, the output must say "your guess of _ was too low. try again" or "your guess of _ was too high. try again" or "you guessed it!"
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
- Objective: Must create an interactive program (in C language) in which the computer generates a random number between 1 and 15. The user is presented with a guessing game and must enter their guess as to which number the computer is "thinking of" (the randomly generated number between 1 and 15). The user is limited to five guesses. If the user guesses the correct number within the five guess limit, they win. If the user does not guess correctly within the five guess limit, they lose the game. Following each user input, the output must say "your guess of _ was too low. try again" or "your guess of _ was too high. try again" or "you guessed it!"
- Instructions: The program must make use of passing by value and reference, if-else, defined constants, and use of the random number generator/seeding. The seed function srand() should only be called once in main. The point is to demonstrate use of multiple functions (those aforementioned) even though this could be accomplished with a much smaller, simpler program.
If the user types no, the output terminal should look like userno.PNG.
If the user types yes, useryes.PNG is an example of what the output terminal should look like.
I hope this made sense and I thank you more than words can say.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps