the secret number guessing game you made in the previous task. The secret numbers must be random (hint, you can simply google "C generate random numbers"). Have more than one level. For example, the secret number for level 1 is a number between 1 and 10, the secret number for level 2 is a number between 1 and 100, the secret number for level 3 is a number between 1 and 1000, etc. The user can be given a fixed number of maximum guesses. For example, for the first level, the user has a maximum of 3 guesses. The user gets an additional 5 guesses for the second level if the user succeeds in guessing the secret number in level 1. Meaning if the user used all guesses, the user has 5 guesses in level 2, but if the user used only 1 out of the 3 guesses in level 1, the user will still have the 2 guesses from level 1 plus the 5 additional guesses for level 2 (therefore total of 7 guesses for level 2). An additional 10 guesses for level 3 will be added if the user makes it that far. Etc. The game ends when the user uses all of the user's guesses without correctly guessing the secret number, or until he succeeds in the last level.

EBK JAVA PROGRAMMING
8th Edition
ISBN:9781305480537
Author:FARRELL
Publisher:FARRELL
Chapter2: Using Data
Section: Chapter Questions
Problem 2GZ
icon
Related questions
Question
Context for question: The user inputs the secret number, then the computer guesses your secret number by randomly generating numbers. The program should automatically output if the user's secret number is higher or lower than the computer's guess. The computer can then use this information for its next random guess. Although the computer's guesses are random, think of ways to make the computer's guesses intelligent, without the computer using the secret number the user entered (that would be cheating on the part of the computer). #include #include #include int main() { int secretNumber, guess; printf("Enter Secret Number: "); scanf("%d", &secretNumber); do { guess = (rand() % 100 + 1); printf("The guess is %d", guess); if (secretNumber == guess){ printf("\nYour guess is correct. Congratulations!\n"); }else if(secretNumber > guess){ printf("\nYour secret number is higher than the guess number.\n"); }else if(secretNumber < guess){ printf("\nYour secret number is smaller than the guess number.\n"); } }while (secretNumber != guess); return 0; } Do the following REQUIRED: Modify the secret number guessing game you made in the previous task. The secret numbers must be random (hint, you can simply google "C generate random numbers"). Have more than one level. For example, the secret number for level 1 is a number between 1 and 10, the secret number for level 2 is a number between 1 and 100, the secret number for level 3 is a number between 1 and 1000, etc. The user can be given a fixed number of maximum guesses. For example, for the first level, the user has a maximum of 3 guesses. The user gets an additional 5 guesses for the second level if the user succeeds in guessing the secret number in level 1. Meaning if the user used all guesses, the user has 5 guesses in level 2, but if the user used only 1 out of the 3 guesses in level 1, the user will still have the 2 guesses from level 1 plus the 5 additional guesses for level 2 (therefore total of 7 guesses for level 2). An additional 10 guesses for level 3 will be added if the user makes it that far. Etc. The game ends when the user uses all of the user's guesses without correctly guessing the secret number, or until he succeeds in the last level.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Multithreading Methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr