Write a complete C++ program that inputs three numbers representing the number of pins knocked down...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a complete C++ program that inputs three numbers representing the number of pins knocked down by a bowler in three throws. Your program should output the computed bowling score, and check for possible input errors. For example, a throw may be in the range of 0 through 10 points, and the total of the first 2 throws must be less than or equal to 10, except when the 1st throw is a strike. The rules of bowling are that if the first throw is a strike (all 10 pins knocked down), then the score is equal to those 10 points plus the number knocked down in the next 2 rows. Thus the maximum score (3 strikes) is 30. If the 1st throw knocks down fewer than 10 pins, but the second throw knocks down the remainder of the 10 pins (a spare), then the score is those 10 points plus the number of pins knocked down on the third throw. If the first 2 throws fail to knock down all of the pins (a blow). then the score is just the total number of pins knocked down in the first 2 throws. (20 marks) Write a complete C++ program that inputs three numbers representing the number of pins knocked down by a bowler in three throws. Your program should output the computed bowling score, and check for possible input errors. For example, a throw may be in the range of 0 through 10 points, and the total of the first 2 throws must be less than or equal to 10, except when the 1st throw is a strike. The rules of bowling are that if the first throw is a strike (all 10 pins knocked down), then the score is equal to those 10 points plus the number knocked down in the next 2 rows. Thus the maximum score (3 strikes) is 30. If the 1st throw knocks down fewer than 10 pins, but the second throw knocks down the remainder of the 10 pins (a spare), then the score is those 10 points plus the number of pins knocked down on the third throw. If the first 2 throws fail to knock down all of the pins (a blow). then the score is just the total number of pins knocked down in the first 2 throws. (20 marks)
Expert Answer:
Answer rating: 100% (QA)
SOURCE CODE include include using namespace std int main variable declaratio... View the full answer
Related Book For
Stats Data And Models
ISBN: 9780135163825
5th Edition
Authors: Richard D De Veaux, Paul F Velleman, David E Bock
Posted Date:
Students also viewed these programming questions
-
You have been provided with the description of a programming language, J, intended for scripting applications. Its syntax is similar to a cut-down version of Java in that it consists of function...
-
ccn2 java solve them all . . . r2 e1 e2 box r2 Write sound typing and subtyping rules for these constructs. [5 marks] Now suppose that we add to this calculus the type variables and bounded universal...
-
Chemistry A one-electron atom is an atom with Z protons in the nucleus and one electron. For example, Z = 2 for helium and Z = 3 for lithium. Use our class discussion of the allowed radii and...
-
A foreign subsidiary uses the first-in first-out inventory method. The following inventory balances are given at December 31, 2013 in local currency units (LCU): Inventory at...
-
What three guidelines help management accountants provide the most value to managers?
-
With reference to Exercise 3.1, suppose that the points \((0,0),(0,1),(0,2),(0,3),(1,0),(1,1),(1,2),(1,3)\), \((2,0),(2,1),(2,2),(2,3),(3,0),(3,1),(3,2)\), and \((3,3)\) have the probabilities...
-
Suppose that in court, Durbin argues that because the school closed down before he could finish his education, there was a failure of consideration: he did not get something of value in exchange for...
-
HR manager is looking into employee absence. 10% of all plant employees work in the finishing department; 20% of all plant employees are absent excessively; and 7% of all plant employees work in the...
-
When it comes to terminating leases, explain the scope of authority and limitations a property manager has regarding his or her professional responsibilities and skills?
-
(a) Mutale and Kafula are in business trading as partners. The following g is the draft statement of profit or loss for the partnership for the year ended 31 December 2020: (b) Gross profit Expenses...
-
Phill Steganography Project Attached Files: Image Steganography Setup.zip (342.015 KB) Since this is not really covered in TestOut, I have provided the above tutorial on using Image Steganography. In...
-
A P/inS = 80% # of units sold from P to S in year 1 # of units sold from P to S in year 2 # of units sold from S to P in year 1 # of units sold from S to P in year 2 # of units sold from S to...
-
Select] Within the Boston Consulting Group (BCG) Matrix. are offerings that are capturing a relatively high percentage of the market in a low-growth (i.e.. not growing quickly) market. We only want...
-
Writing Strong Body Paragraphs Overview: a organized A body paragraph is where you develop the ideas in your essay. A body paragraph is not stream of consciousness collection of ideas that you write...
-
2. Consider water is to be heated in a tube equipped with electric resistance heater on its surface. The power rating of the heater and inner surface temperature are to be determined? Properties of...
-
a. What is meant by the term tax haven? b. What are the desired characteristics for a country if it expects to be used as a tax haven? c. What are the advantages leading an MNE to use a tax haven...
-
Commuter sample The data file Commuter sample holds a sample drawn from the Population commute times data set. Using your statistics program make histograms of the sample and the population. Discuss...
-
Legionnaires disease In 1974, the Bellevue-Stratford Hotel in Philadelphia was the scene of an outbreak of what later became known as Legionnaires disease. The cause of the disease was finally...
-
Spanking In a 2015 Pew Research study on trends in marriage and family (www.pewsocialtrends.org/2015/12/17/1-the-american-family-today/), 53% of randomly selected parents said that they never spank...
-
True or False: The capital recovery cost is the uniform annual cost of the investment less the uniform annual worth of the salvage value.
-
When using annual worth to evaluate the attractiveness of a single alternative, what value is the calculated AW compared to? a. PW b. FW c. 0.0 d. MARR
-
True or False: If AW > 0, then PW > 0, and FW > 0.
Study smarter with the SolutionInn App