Write a C++ program that generates a random number between 1 and 200. The program will...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a C++ program that generates a random number between 1 and 200. The program will keep asking the user to input a number and display corresponding message based on the input, telling the user if the guess is bigger or smaller than the generated number or out of range. If the user enters the correct answer, the program will display a message showing how many guesses have been made and exit (if the guess is out of range, it does not count as one guess). Here is a sample run: A number is generated, make a guess: 68 Your guess is too big, make a guess: 20 Your guess is too small, make a guess: 202 Your guess is out of range, make a guess: 44 You got it right! It took 3 times to get the correct answer. Write a C++ program that generates a random number between 1 and 200. The program will keep asking the user to input a number and display corresponding message based on the input, telling the user if the guess is bigger or smaller than the generated number or out of range. If the user enters the correct answer, the program will display a message showing how many guesses have been made and exit (if the guess is out of range, it does not count as one guess). Here is a sample run: A number is generated, make a guess: 68 Your guess is too big, make a guess: 20 Your guess is too small, make a guess: 202 Your guess is out of range, make a guess: 44 You got it right! It took 3 times to get the correct answer. Write a C++ program that generates a random number between 1 and 200. The program will keep asking the user to input a number and display corresponding message based on the input, telling the user if the guess is bigger or smaller than the generated number or out of range. If the user enters the correct answer, the program will display a message showing how many guesses have been made and exit (if the guess is out of range, it does not count as one guess). Here is a sample run: A number is generated, make a guess: 68 Your guess is too big, make a guess: 20 Your guess is too small, make a guess: 202 Your guess is out of range, make a guess: 44 You got it right! It took 3 times to get the correct answer.
Expert Answer:
Answer rating: 100% (QA)
Here is a simple C program that fulfills the requirements youve described include include include in... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Case Study: Quick Fix Dental Practice Technology requirements Application must be built using Visual Studio 2019 or Visual Studio 2017, professional or enterprise. The community edition is not...
-
Determine the degrees of freedom under the following conditions: (a) Tl-20 wt% Pb at 325 C and 400 C; (b) Tl-40 wt% Pb at 325 C and 400 C; (c) Tl-90 wt% Pb at 325 C and 400 C. Refer to the phase...
-
The statement of cash flows of Picture Perfect Photography reported the following for the year ended December 31, 2014: Cash flows from financing activities Dividends [declared and]...
-
Use the WKB approximation in the form of Equation 9.52, to estimate the bound state energies for hydrogen. Dont forget the centrifugal term in the effective potential (Equation 4.38). The following...
-
What are the advantages and disadvantages of taking a deposition?
-
Coppola, who collected coins, joined a coin club, First Coinvestors, Inc. The club would send coins to its members, who were to pay for them or return them within 10 days. What was the nature of the...
-
1. Typical capital budgeting approaches does not account for the potential value of future expansion opportunities which may become available later in the life of the project. a)Provide an example of...
-
Castelo Branco Lda is a manufacturer of video-conferencing products. Regular units are manufactured to meet marketing projections, and specialised units are made after an order is received....
-
Your digital marketing agency has been hired by the NFL and the Kansas City Sports Commission to develop a digital marketing and social media plan for the 2023 NFL Draft to be held in Kansas City....
-
5. Boundary Value Problem: Consider the boundary value problem given by d y =-y dx with boundary conditions and y(0) = 1 y() = -1 . Solve this problem using the method of separation of variables.
-
2. According University of Maryland records, 0.55 of undergraduate students have lived in Maryland, 0.38 of undergraduate students have lived in states other than Maryland, and 0.16 of undergraduate...
-
An unknown force is applied to a 5 kg object. The force acts at an angle of 30 above the horizontal. Determine the force acting on the object if the object horizontally displaces 30 meters and if its...
-
Stone Company is facing several decisions regarding investing and financing activities. Address each decision independently. 1. On June 30, 2024, the Stone Company purchased equipment from Paper...
-
A heat engine receives 75.0 MJ from a thermal reservoir and rejects 975 kJ over a 1 hour interval. What is the output power of the engine?
-
x)2 (3 points). Compute 6(n) X A) 1 B) 2e-2 C) 2 D) 6e-6 E) 3e (3 points). Compute A) T B) 0 C) 2T D) 1 E) -1 -TT -dx x[4 sin x + tan (3x)]dx 4
-
Consider the function f and its graph. a. Estimate the zeros of the area function b. Estimate the points (if any) at which A has a local maximum or minimum. c. Sketch a graph of A, for 0 x 10,...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1 and 2. On September 1, Irene opened a retail store that specializes in sports car...
-
Dr. Ivan I. Incisor and his wife Irene are married and file a joint return for 2012. Ivan's Social Security number is 477-34-4321 and he is 48 years old. Irene I. Incisor's Social Security number is...
-
Lisa Sizemore, a taxpayer in the 10-15 percent tax bracket, purchased stock as an investment on July 11, 2011. She sold the stock on July 9, 2012, 2 days before qualifying for the long-term holding...
-
Assume that Boardmaster sold skateboards to a department store for \($35,000\) cash. How would this transaction affect Boardmasters accounting equation? a. Increase both assets and stockholders...
-
Generally Accepted Accounting Principles (GAAP) are created by the a. Securities and Exchange Commission (SEC). b. Financial Accounting Standards Board (FASB). C. Institute of Management Accountants...
-
Boardmaster is famous for custom skateboards. At the end of a recent year, Boardmasters total assets added up to \($622\) million, and stockholders equity was \($487\) million. How much did...
Study smarter with the SolutionInn App