random number guessing game with while loops create a program (or adapt the guessing game program that's posted in moodle a couple of weeks ago) that asks the user to guess a random number between one and sixteen, and compares their guess with the computer's number. save this program as guessLoops.cpp The program should display one of four messages: if your guess is higher than the computer's number: "Your guess is too high." if your guess is lower than the computer's number: "Your guess is too low." if your guess is the same as the compu
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:
/*random number guessing game with while loops
create a program (or adapt the guessing game program that's posted in moodle
a couple of weeks ago) that asks the user to guess a random number between one and sixteen,
and compares their guess with the computer's number.
save this program as guessLoops.cpp
The program should display one of four messages:
if your guess is higher than the computer's number: "Your guess is too high."
if your guess is lower than the computer's number: "Your guess is too low."
if your guess is the same as the computer's number: "That is correct!"
if your guess is less than one or greater than sixteen: "Invalid guess."
If it's the last one, invalid guess, prompt the user, by using a loop, to guess again.
If your guess is too high or too low, ask the user if they'd like to guess again (if the
answer is 'y' for yes, repeat the statements that asks for a guess.
Then, repeat statement on line #6-#9 above.
If the answer is 'n' for no (meaning the user doesn't want to guess again),
display an ending statement, like
"Thanks for playing." and end the program.
test your program;
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images