**Program needs to be in matlab format** A bowling match consists of ten frames. Each frame...

50.1K

Verified Solution

Question

Advance Math

**Program needs to be in matlab format**

A bowling match consists of ten frames. Each frame except forthe tenth consists of one or two balls, or attempts to knock downthe ten pins at the end of the alley. Doing so on the first ball ofthe frame is called a strike, and the second ball of the frame isnot rolled. Knocking down all ten pins with both balls (having leftsome up with the first ball) is called a spare. If both attempts toknock down the pins leave some standing, the frame is called anopen frame. A spare in the tenth frame gives the bowler one extraball; a strike in the tenth gives him or her two extra balls. Abowling score is computed as follows. A strike counts as 10 pointsplus the sum of the next two balls. A spare counts as 10 pointsplus the next ball. Any other balls merely count as themselves, asdo any bonus balls rolled as a result of a strike or a spare in thetenth frame. Suppose for example that the sequence of balls was 9 10 10 10 10 6 2 7 3 8 2 10 9 0 9 1 10 The score for the ten frameswould be Frame score ----- ----- 1 10 2 30 3 56 4 74 5 82 6 100 7120 8 139 9 148 10 168 Your goal in this project is to write aprogram to accept from standard input the scores for a sequence ofballs and output the scores for the ten frames. The program shouldask for input for each frame, asking for a second score if thefirst roll was not a strike. At most bowling alleys, thecomputerized scoring machines congratulate bowlers when they aredoing a good job. When a bowler achieves consecutive strikes,output the following, according to the number of consecutivestrikes: No. of consecutive strikes Output 2 Double! 3 Turkey! 4Hambone! 5 Yahtzee! 6 Wild Turkey! This is a two week homework. Forthis homework, you will need to come up with an outline of goalsfor the project. By the end of the first week, your program shouldbe able to do the following things: -Add up scores for the firstnine frames (do NOT worry about the tenth frame yet) for bothsimple bowls (no strikes or spares) and frames that involve sparesYou will evaluate each other's code in class with several tests tosee if the code does indeed successfully calculate simple games andgames that involve spares. The complete checklist that you will beevaluated on is below: -The program runs -The program asks forscores one at a time (not for all of them at once) -The programasks for scores for 9 frames -Test the program for the followingeasy case: Every frame you bowl zero for both times. --Does theprogram output a final score? --Is the final score correct (i.e.0)? --Does the program output the score at the end of every frame?-Next, test the program for the next most difficult case: Everyframe you bowl a score of 1. -Is the final score correct (i.e. 18)?-Next, test the program to see if it successfully calculatesspares. For the first two frames, the bowler bowls a 5 on the firstthrow and a 5 on the second throw. For frames 3-9, the bowlerthrows zeros. -Is the final score correct (i.e. 25)? -Lastly, testthe program for a case in which you have many spares. For everyframe, the bowler bowls a 5 on the first throw and a 5 on thesecond throw. -Is the final score correct (i.e. 135)? -The programdoes not crash (i.e. encounter Octave errors) for any of the testcases.

Answer & Explanation Solved by verified expert
4.2 Ratings (449 Votes)
IF YOU HAVE ANY DOUBTS COMMENT BELOW I WILL BE TTHERE TO HELP YOUALL THE BEST CODE package comdummysuriya import javautil public class BowlingAlleyTest private static final int MAXSCORE 10 public static void mainString args To    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students