Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please solve in java please ! Problem Description Create a program, which, given an integer array of a valid sequence of throws for one game

please solve in java please ! image text in transcribed
Problem Description Create a program, which, given an integer array of a valid sequence of throws for one game of American Ten-Pin Bowling, produces the total score for the game. Your code will become the core of a bowling score management system, so make sure it's production-quality. Your input should be a string like the examples below. Stuff That's Out of Scope Here are some things that the program does not need to do (today): - check for valid throws (like scores that add to 11) - check for the correct number of throws and frames - provide any intermediate scores - it only has to provide the final score The Rules To briefly summarize the scoring for this form of bowling: - One game of bowling is made up of ten frames. - In each frame, the bowler has two throws to knock down all the pins. - Possible results for a frame: - Strike ('X'): the bowler knocks down all 10 pins on the first throw. The frame is over early. The score for the frame is 10 plus the total pins knocked down on the next two throws. Spare ('/'): the bowler knocks down all 10 pins using two throws. The score for the frame is 10 plus the number of pins knocked down on the next throw. Open frame: the bowler knocks down less than 10 pins with his two throws. The score for the frame is the total number of pins knocked down. - The game score is the total of all frame scores. - Special rules for the 10th frame: A strike in the tenth frame gives the bowler two bonus throws, to fill out the scoring formula for the last frame. A spare in the tenth frame gives the bowler one bonus throw, to fill out the scoring formula for the last frame. These throws count as part of the 10th frame. The process does not repeat - for example, knocking down all 10 pins on a bonus throw does not provide any additional bonus throws

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_2

Step: 3

blur-text-image_3

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

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

What will you do or say to Anthony about this issue?

Answered: 1 week ago