Guessing Numbers---The problem is to guess what number a computer has in mind. You will write a program that randomly generates an integer between 0 and 100, inclusive. The program prompts the user to enter a number continuously until the number matches the randomly generated number. For each user input, the program tells the user whether the input is too low or too high, so the user can make the next guess intelligently. Here is a sample run. (do it using while or do-while loop only) Guess a magic number between 0 and 100 Enter your guess: 50 Your guess is too high Enter your guess: 25 Ener Your guess is too low Enter your guess: 42 reer Your guess is too high Enter your guess: 39 enter Yes, the number is 39 Diter

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 14E
icon
Related questions
Question
Write a program in Java
Guessing Numbers---The problem is to guess what number a computer has in
mind. You will write a program that randomly generates an integer between 0
and 100, inclusive. The program prompts the user to enter a number
continuously until the number matches the randomly generated number. For
each user input, the program tells the user whether the input is too low or
too high, so the user can make the next guess intelligently. Here is a sample
run. (do it using while or do-while loop only)
Guess a magic number between 0 and 100
Enter your guess: 50
Your guess is too high
Enter your guess: 25 PErter
Your guess is too low
Enter your guess: 42 Erter
Your guess is too high
Enter your guess: 39 Enter
Yes, the number is 39
Diter
Transcribed Image Text:Guessing Numbers---The problem is to guess what number a computer has in mind. You will write a program that randomly generates an integer between 0 and 100, inclusive. The program prompts the user to enter a number continuously until the number matches the randomly generated number. For each user input, the program tells the user whether the input is too low or too high, so the user can make the next guess intelligently. Here is a sample run. (do it using while or do-while loop only) Guess a magic number between 0 and 100 Enter your guess: 50 Your guess is too high Enter your guess: 25 PErter Your guess is too low Enter your guess: 42 Erter Your guess is too high Enter your guess: 39 Enter Yes, the number is 39 Diter
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Files and Directory
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr