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...
-
Following are five pertinent facts about events during the current year at Babcock's Fly and Tackle, a Prince Edward Island fisheries supply company: a. Sales of $911,000 were covered by Babcock's...
-
Summarize three of Coveys habits in your own words and give examples of how these habits would apply to project management. Document your ideas in a short paper, and include at least two references.
-
Jerome M. Eisenberg is an antiquities dealer and a self-proclaimed expert in classical antiquities with a doctorate in Roman, Egyptian, and Near Eastern art. Maurice E. Hall Jr. is an art dealer who...
-
After the success of the companys first two months, Santana Rey continues to operate Business Solutions. The November 30, 2011, unadjusted trial balance of Business Solutions (reflecting its...
-
What are the capabilities of online analytical processing (OLAP)? What is the value of this tool to business? Is OLAP much different from data mining and warehousing? Explain..!
-
Table, from a General Social Survey, relates responses on R = religious service attendance (1 = at most a few times a year, 2 = at least several times a year), P = political views (1 = liberal, 2 =...
-
1. Your classmate asks you for a loan of $10.00.00 today in exchange for promising you a repayment of $12.00 in one week. You agree to make the loan, knowing that he always carries out his promises....
-
1. Risk of Money Market Investments. What are the three types of risk that affect money market investments? 2. Liquidity During a Weak Economy. Why is it important to have sufficient liquidity during...
-
Oman Cement Company has bought a machinery for RO 85,000 with an estimated useful life of 7 years. Ms. Safia, an Accounting Manager, is responsible to calculate the depreciation and record in the...
-
On November 1 , 2 0 2 2 , Jamie ( who is single ) purchased and moved into her principle residence in Dallas, Texas. Jamie's employer transferred her to an office in Houston., Texas. On Feb 1 , 2 0 2...
-
McKie Ltd has presented you with the following balances for the year ended September 30, 2023: $ $ Creditors 22,500 Sales Revenue 1,143,700 Land at cost 550,000 Building at cost 570,000 Furniture and...
-
How much did a company pay in Dividends during its first year of operations if the company's Net Income was $800000 and its Ending Retained Earnings were $680000? Answer: I
-
After you have recorded all of Beas transactions in a worksheet, you realise that the worksheet may not be the best way to present the information. Bea has indicated that the Bank wants to see an...
-
Find the center of mass of a thin triangular plate bounded by the y-axis and the lines y = x and y = 2 - x if (x, y) = 6x + 3y + 3.
-
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...
-
a. The equation of the Phillips curve from 1970 to 1995 is: \[\pi_{t}-\pi_{t-1}=7.4 \%-1.2 u_{t}\] Calculate and define the natural rate of unemployment using this curve. b. The equation of the...
-
Suppose that the mark-up of goods prices over marginal cost is \(5 \%\), and that the wage-setting equation is: \[W=P(1-u)\] where \(u\) is the unemployment rate. a. What is the real wage, as...
-
How can a lockdown result in stagflation? A lockdown can have three different effects: a. The first happens when demand during the lockdown decreases so that actual output, \(Y_{t}\), falls exactly...
Economic Workbook And Data A Tutorial Volume For Students 1st Edition - ISBN: 0080129587 - Free Book
Study smarter with the SolutionInn App