Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that generates a random number between 0 and 1 0 0 . The program prompts the user to enter a number continuously

Write a program that generates a random number between 0 and 100. The program prompts the
user to enter a number continuously until the number matches the randomly generated number. For
each input, the program tells the user whether the input is too low or too high, so the user can
make next better guess.
Sample Run
Guess a magic number between 0 and 100:
Enter your guess: 50
Your guess is too high
Enter you guess: 25
Your guess is too low
Enter your guess: 42
Your guess is too high
Enter you guess: 39
Yes, you got it!! the number is 39 Write a program in C++ that generates a random number between 0 and 100.The program prompts the user to enter a number continuously until the number matches the randomly generated number. For each input, the program tells the user whether the input is too low or too high, so the user can make next better guess.
Sample Run
Guess a magic number between 0 and 100:
Enter your guess: 50
Your guess is too high
Enter you guess: 25
Your guess is too low
Enter your guess: 42
Your guess is too high
Enter you guess: 39
Yes, you got it!! the number is 39
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

3rd Edition

0071107010, 978-0071107013

More Books

Students also viewed these Databases questions

Question

How does a firm encourage and protect new ideas?

Answered: 1 week ago

Question

What is meant by decentralisation of authority ?

Answered: 1 week ago

Question

Briefly explain the qualities of an able supervisor

Answered: 1 week ago

Question

Define policy making?

Answered: 1 week ago

Question

Define co-ordination?

Answered: 1 week ago

Question

What are the role of supervisors ?

Answered: 1 week ago

Question

What is the difference between Needs and GAP Analyses?

Answered: 1 week ago

Question

What are ERP suites? Are HCMSs part of ERPs?

Answered: 1 week ago