This assignment asks you to implement a guessing game as a C++ program. For this you...
Fantastic news! We've located the answer you've been seeking!
Question:
Transcribed Image Text:
This assignment asks you to implement a guessing game as a C++ program. For this you need to familiarize yourself with variables, ifs (nested and multiple ifs), random numbers, and loops. The program should do the following: Print a welcome message • Repeat the following until the game is over indicated by user entering Q' or 'q'. o Select a random number between 1 and 20. o Ask the user to input a number between 1 and 20. o Check if the user input is equal to the generated random number. • If they are equal then the user has won. Print appropriate message. If they are not equal then give the user a hint as to whether the user's entered number is greater or less than the random number and provide two more turns to the user giving the hint at each turn. (Total number of tries at guessing the generated random number is three (3)) Below is a screenshot of a working program: Scenario 1 EACS11 Gem 1200nAnigment NCST1AtignSt Sktion ee A number has been randomly generated between 120 inclusive....Guess the number: 15 You have to go higher. You have 2 attempt(s) left A number has been randomly generated between 120 inclusive....Guess the number: 17 You have to go lower. You have 1 attempt(s) left A number has been randomly generated between 120 inclusive....Guess the number: 16 CONGRATULATIONS... You Win :) Enter 'Y' to play the guessing game or 'Q' to quit Exercise 1 [Organize & Manage . (a) Write a pseudocode for your program. Exercise 2 [Find & Generate] Please answer the following: Which variables do you need? Which variables do you use for input? Which types do you use for which variable. Explain why? What type of loop is best to validate the input? What is the loop condition?
Expert Answer:
Answer rating: 100% (QA)
CODE include include using namespace std int main char ch Y for contin View the full answer
Related Book For
Managerial economics applications strategy and tactics
ISBN: 9781439079232
12th Edition
Authors: James r. mcguigan, R. Charles Moyer, frederick h. deb harris
Posted Date:
Students also viewed these computer engineering questions

This assignment asks you to implement a guessing game as a C++ program. For this you need to familiarize yourself with variables, ifs (nested and multiple ifs), random numbers, and loops. The program...

The Managing Director, Tom Copeland has asked you to implement a process to monitor expenditure and income. He has asked you to prepare a spreadsheet to capture and compare actual income and...

Your boss has asked you to implement a new rotating work schedule that requires employees to work different schedules each week. Your boss would like to know how other companies in the area have...

In December 2014, Shire Computer's management establishes the 2015 predetermined overhead rate based on direct labor cost. The information used in setting this rate includes estimates that the...

At the end of the year, when closing the books, what is the treatment for immaterial standard variance account balances? What is the treatment for standard variance account balances that are material...

The accountant for a subunit of Speed Sports Company went on vacation before completing the subunit's monthly responsibility report. This is as far as she got: Requirements 1. Complete the...

Assume that a computer has eight general purpose registers R0R7, a stack pointer register SP, and program counter PC. If the calling convention for this computer is that registers R0 and R1 are used...

Indicate whether the following statements are true or false. If the statement is false, explain why. a. If a firm repurchases its stock in the open market, the shareholders who tender the stock are...

Prosecutions for failure to comply with WHS for a given event may proceed against 1 An individual 2 A company or individual but not both 3 A company 4 Both a company and an individual

Shankar Manufacturing Company produces a product that is manufactured in two departments. The product is cut out of wood in the Cutting Department and then transferred to the Assembly Department,...

Henry and Jones, partners in a sports management consulting firm, budgeted the following professional labor hours for the year ended December 31, 20:...

In Problems 21 through 24, show that the matrix A is nilpotent and then use this fact to find (as in Example 3) the matrix exponential e At . A = 1 1

Compute the matrix exponential e At for each system x' = Ax given in Problems 9 through 20. x' 1 = 5x 1  4x 2 , x' 2 = 3x 1  2x 2 Data in Problem 9 through 20 9. x = 5x14x2, x = 2x1x2 x = 4x14x2...

In Problems 23 through 32, find a particular solution of the indicated linear system that satisfies the given initial conditions. The system of Problem 15: x 1 (0) = 5, x 2 (0) = 3 Data from in...

The phase portraits in Problems 17 through 28 correspond to linear systems of the form x' = Ax in which the matrix A has two linearly independent eigenvectors. Determine the nature of the eigenvalues...

The phase portraits in Problems 17 through 28 correspond to linear systems of the form x' = Ax in which the matrix A has two linearly independent eigenvectors. Determine the nature of the eigenvalues...

A. Explain the five models of decision making in Central government and respective roles of both civil servants and ministers play within thosr models? B. Assess the extent to which these help...

Determine which of the following limits exist. Compute the limits that exist. lim x0 1 + 3x X

In 20082009, the price of jet and diesel fuel used by air freight companies decreased dramatically. As the CEO of FedEx, you have been presented with the following proposals to deal with the...

Nike and Adidas face the following coordination problem in trying to decide whether to conduct heavy or light combative advertising against the other firm. What should each firmdo? Nike Light Ads...

The profitability of the leading cola syrup manufacturers PepsiCo and CocaCola and of the bottlers in the cola business is very different. PepsiCo and CocaCola enjoy an 81 percent operating profit...

Garage, Inc., has identified the following two mutually exclusive projects: a. What is the IRR for each of these projects? Using the IRR decision rule, which project should the company accept? Is...

For the cash flows in the previous problem, what is the NPV at a discount rate of zero percent? What if the discount rate is 10 percent? If itis 20 percent? If it is 30 percent? Data From Previous...

Suppose a project has conventional cash flows and a positive NPV. What do you know about its payback? Its discounted payback? Its profitability index? Its IRR? Explain.
Question Categories