Got Homework?
Connect with other students for help. It's a free community.
Here's the question you clicked on:
 0 viewing
Shopaps
Group Title
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
 2 years ago
Shopaps Group Title
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
 2 years ago

This Question is Closed

mas_gh90 Group TitleBest ResponseYou've already chosen the best response.0
C?java?what?
 2 years ago

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

mominanisar Group TitleBest ResponseYou've already chosen the best response.1
1.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.
 2 years ago
See more questions >>>
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.