Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a MATLAB program that takes a sequence of numbers representing pins knocke

ID: 3792467 • Letter: W

Question

Write a MATLAB program that takes a sequence of numbers representing pins knocked down in a 10 frame game of bowling and generates the score according to the rules of bowling. The program must prompt the user to enter a vector containing results of each of the 10 frames, each number separated by a space.

Strike

If you knock down all 10 pins in the first shot of a frame, you get a strike.
How to score: A strike earns 10 points plus the sum of your next two shots.

Spare

If you knock down all 10 pins using both shots of a frame, you get a spare.
How to score: A spare earns 10 points plus the sum of your next one shot.

Open Frame

If you do not knock down all 10 pins using both shots of your frame (9 or fewer pins knocked down), you have an open frame.
How to score: An open frame only earns the number of pins knocked down.

The 10th Frame

The 10th frame is a bit different:
If you roll a strike in the first shot of the 10th frame, you get 2 more shots.
If you roll a spare in the first two shots of the 10th frame, you get 1 more shot.
If you leave the 10th frame open after two shots, the game is over and you do not get an additional shot.
How to Score: The score for the 10th frame is the total number of pins knocked down in the 10th frame.

Explanation / Answer

Strike:

   10 pins in the first shot in frame ,frame mens 10 total 100pins eran 10 pins ,total score 110 in first shot.

Spare:

down all 10 pins using both shots of a frame means 10 pins 1 frame so total score is 90

Open Frame

An open frame only earns the number of pins knocked down score 99

The 10th Frame:

total score is 1000

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote