A community for students. Sign up today!
Here's the question you clicked on:
 0 viewing
 2 years ago
Create a program that simulates a guessing game.
The program prompts for a number and check it against an internal one.
Example: secret_number=123;
I have a secret number.
Guess the secret number: 345
Your guess was too high.
You get 4 more tries.
Guess the secret number: 100
Your guess was too low.
You get 3 more tries
Guess the secret number: 150
Your guess was too high.
You get 2 more tries.
Guess the secret number: 140
Your guess was too high
You get 1 more tries
Guess the secret number: 120
Your guess was too low.
Sorry you get no more chances.
Note: you can use the ran
 2 years ago
Create a program that simulates a guessing game. The program prompts for a number and check it against an internal one. Example: secret_number=123; I have a secret number. Guess the secret number: 345 Your guess was too high. You get 4 more tries. Guess the secret number: 100 Your guess was too low. You get 3 more tries Guess the secret number: 150 Your guess was too high. You get 2 more tries. Guess the secret number: 140 Your guess was too high You get 1 more tries Guess the secret number: 120 Your guess was too low. Sorry you get no more chances. Note: you can use the ran

This Question is Closed

mas_gh90
 2 years ago
Best ResponseYou've already chosen the best response.0sorry I don't know C,if it was java,I was able to help u :(

mominanisar
 2 years ago
Best ResponseYou've already chosen the best response.11.first store your secret no in some variable(i mean as a variable value). 2.then use a loop which run for five times. 3.inside that loop use the inputting statement to ask the user to enter the no and the use equality operator to check whether it is equal to your secret no . 4.if it is equal to your secret no then use break statement to end the loop. 5.and print whatever message you can. otherwise ask the user to enter the no again for guessing.
Ask your own question
Ask a QuestionFind more explanations on OpenStudy
Your question is ready. Sign up for free to start getting answers.
spraguer
(Moderator)
5
→ View Detailed Profile
is replying to Can someone tell me what button the professor is hitting...
23
 Teamwork 19 Teammate
 Problem Solving 19 Hero
 Engagement 19 Mad Hatter
 You have blocked this person.
 ✔ You're a fan Checking fan status...
Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.