PROGRAM ANALYSIS
Q3. Calculate score for a 10-pin bowling game, which usually have 10 frames. The score is
based on the number of pins knocked down. You are to enter the number of pins knocked
down for each throw for each frame, giving correct extra points for strikes and spares.
Group Member
111564 MOHAMED AMIN BIN MUHAMMAD ALI
111708 MOHD AMIRUL HAIRI BIN ADUKA
111496 MOHAMAD IZZUDDIN BIN ROZALI
111513 MOHAMAD NISHAMASRAAF BIN MOHD YUSOFF
10-Pin Bowling
Play
The bowler is allowed 10 frames in which to knock down pins, with frames one (1) through
nine (9) being composed of up to two rolls. The tenth frame may be composed of up to three
rolls: the bonus roll(s) following a strike or spare in the tenth (sometimes referred to as the
eleventh and twelfth frames) are fill ball(s) used only to calculate the score of the mark rolled
in the tenth.
Bowling has a unique scoring system which keeps track not only of the current score but also
strikes and spares, which give multiple marks. Effectively, there are three kinds of marks
given in a score; a strike (all ten down in the first ball), a spare (all ten down by the second
ball), and an open (missed pins still standing when the turn ends). A strike earns ten points
plus the points for the next two balls thrown (for example, if a player got a strike then
followed with a 7 then 2, their value for the strike would be 10+7+2, or 19). A spare earns ten
points plus the points for the next ball thrown (again, if a player gets a spare then follow it
with 7 pins down, their value for the spare would be 10+7, or 17). Open frames are added
normally (example: if a player knocks down 5 on their first ball and 3 on their second the first
open frame would be worth 8 points). The maximum score in tenpin bowling is 300. This
consists of getting 12 strikes in a row in one game (one strike each in frames 1–9, and all
three possible strikes in the tenth frame), and is also known as a perfect game.
Rules of play
A game of bowling consists of ten frames. In each frame, the bowler will have two chances to
knock down as many pins as possible with his bowling ball. In games with more than one
bowler, as is common, every bowler will take his frame in a predetermined order before the
next frame begins. If a bowler is able to knock down all ten pins with the first ball, he is
awarded a strike. If the bowler is able to knock down all 10 pins with the two balls of a
frame, it is known as a spare. Bonus points are awarded for both of these, depending on what
is scored in the next 2 balls (for a strike) or 1 ball (for a spare). If the bowler knocks down all
10 pins in the tenth frame, the bowler is allowed to throw 3 balls for that frame. This allows
for a potential of 12 strikes in a single game, and a maximum score of 300 points, a perfect
game. The player with the most points at the end of ten frames wins. Although if time runs
out before the end of ten frames bowling stops, and the person with the most points wins the
game.
Scoring
In general, one point is scored for each pin that is knocked over. So if a player bowls over
three pins with the first shot, then six with the second, the player would receive a total of nine
points for that frame. If a player knocks down 9 pins with the first shot, but misses with the
second, the player would also score nine. When a player fails to knock down all ten pins after
their second ball it is known as an open frame.
In the event that all ten pins are knocked over by a player in a single frame, bonuses are
awarded.
A ten-pin bowling scoresheet showing how a strike is scored
Strike: When all ten pins are knocked down with the first ball (called a strike and typically
rendered as an "X" on a scoresheet), a player is awarded ten points, plus a bonus of
whatever is scored with the next two balls. In this way, the points scored for the two balls
after the strike are counted twice.
Frame 1, ball 1: 10 pins (strike)
Frame 2, ball 1: 3 pins
Frame 2, ball 2: 6 pins
The total score from these throws is:
Frame one: 10 + (3 + 6) = 19
Frame two: 3 + 6 = 9
TOTAL = 28
Two consecutive strikes are referred to as a "double". Some locations still call it a
"Hambone" even though that term has been changed to mean 4 strikes in a row by
announcers on television.
A double's pinfall is:
Frame 1, ball 1: 10 pins (Strike)
Frame 2, ball 1: 10 pins (Strike)
Frame 3, ball 1: 9 pins
Frame 3, ball 2: 0 pins (recorded as a dash '-' or '0' on the scoresheet)
The total score from these throws is:
Frame one: 10 + (10 + 9) = 29
Frame two: 10 + (9 + 0) = 19
Frame three: 9 + 0 = 9
TOTAL = 57
Three strikes bowled consecutively are known as a "turkey" or "triple".
A turkey's pinfall is:
Frame 1, ball 1: 10 pins (Strike)
Frame 2, ball 1: 10 pins (Strike)
Frame 3, ball 1: 10 pins (Strike)
Frame 4, ball 1: 0 pins (Gutterball)
Frame 4, ball 2: 9 pins
The total score from these throws is:
Frame one: 10 + (10 + 10) = 30
Frame two: 10 + (10 + 0) = 20
Frame three: 10 + (0 + 9) = 19
Frame four: 0 + 9 = 9
TOTAL = 78
Longer strings of strikes are called by various names, including "-Bagger" (Four Bagger) and
"-Pack" (Six Pack) depending on local use, equipment, and exposure to the sport.[24][25]
Recently, the event of bowling four consecutive strikes has also been called a "hambone".[26]
Six strikes and nine strikes in a row can also be referred to "Wild Turkeys" and "Golden
Turkeys" respectively. Any string of strikes starting in the first frame or ending "off the
sheet" (where all of a bowler's shots from a certain frame to the end of the game strike) are
often referred to as the "front" or "back" strikes, respectively (e.g. the "front nine" for strikes
in frames 1–9, or the "back six" for strikes in frames 7, 8, and 9 with a turkey in the tenth). A
"perfect game" or 12 strikes in a row is also rarely referred to as the "Thanksgiving Turkey".
A "Clean Game" is a game with strikes or spares in every frame (not counting bonus balls).
A player who scores multiple strikes in succession would score like so:
Frame 1, ball 1: 10 pins (strike)
Frame 2, ball 1: 10 pins (strike)
Frame 3, ball 1: 4 pins
Frame 3, ball 2: 2 pins
The score from these throws are:
Frame one: 10 + (10 + 4) = 24
Frame two: 10 + (4 + 2) = 16
Frame three: 4 + 2 = 6
TOTAL = 46
The most points that can be scored in a single frame is 30 points (10 for the original strike,
plus strikes in the two subsequent frames).
A player who bowls a strike in the tenth (final) frame is awarded two extra balls so as to
allow the awarding of bonus points. If both these balls also result in strikes, a total of 30
points (10 + 10 + 10) is awarded for the frame. Some people call it "striking out", since three
strikes in baseball equals an out.
A ten-pin bowling scoresheet showing how a spare is scored
spare: A "spare" is awarded when no pins are left standing after the second ball of a frame;
i.e., a player uses both balls of a frame to clear all ten pins. A player achieving a spare is
awarded ten points, plus a bonus of whatever is scored with the next ball (only the first ball
is counted). It is typically rendered as a slash on scoresheets in place of the second pin count
for a frame.
Example:
Frame 1, ball 1: 7 pins
Frame 1, ball 2: 3 pins (spare)
Frame 2, ball 1: 4 pins
Frame 2, ball 2: 2 pins
The total score from these throws is:
Frame one: 7 + 3 + 4 (bonus) = 14
Frame two: 4 + 2 = 6
TOTAL = 20
A player who bowls a spare in the tenth (final) frame is awarded one extra ball to allow for
the bonus points.
Correctly calculating bonus points can be difficult, especially when combinations of strikes
and spares come in successive frames. In modern times, however, this has been overcome
with automated scoring systems, linked to the machines that set and clear the pins between
frames. A computer automatically counts pins that remain standing, and fills in a virtual score
sheet (usually displayed on monitors above each lane). However, even the automated system
is not fool-proof, as the computer can miscount the number of pins that remain standing.
The maximum score in a game of ten-pin is 300, scored by making 12 strikes in a row.
Before 1908, no one ever received an award for a game greater than 298. ABC used to award
medals for the three highest individual games rolled in the nation. The number of perfect
games bowled during a season first became a problem for American Bowling Congress
(ABC) officials in 1908 when the organization was only 13 years old. The crisis struck when
A.C. Jellison and Homer Sanders, both of St. Louis bowled 300 games in the same season.
Perplexed with the problem of having only one gold medal and unwilling to duplicate the
award, the ABC decreed that both had to vie for it in a three-game match at the ABC
tournament in Pittsburgh. Jellison, who won the gold, is recognized as the holder of the
record for the first perfect game in ABC history without regard as to which feat was
performed first. For his accomplishment, Sanders received a silver medal and a place in trivia
history. Earnest Fosberg of East Rockford, Ill. bowled the first ever 300, however, no awards
were available in 1902.
Jeremy Sonnenfeld of Sioux Falls, S.D. made bowling history on Feb. 2, 1997 when he
became the first person ever to roll three sanctioned perfect games in a three-game series. He
was not the first person to shoot a 900 series. But it was the first recognized by ABC. ABC
has relaxed their criteria for sanctioning scores in the past few years.
In Britain, the youngest bowler ever to achieve a perfect single game score of 300 (12
consecutive strikes), in a sanctioned competition was 12 years, 71 days old Elliot John
Crosby, at AMF Purley in South London, England in the Surrey County trials on January 7,
2006.[27] Crosby beat the previous British 300 shooter record holder Rhys Parfitt by more than
a year. Parfitt was 13 years, 4 months when he achieved a 300 point game at the London
international tenpin bowling tournament in 1994. In the United States, the youngest ever
bowler to achieve this in a sanctioned competition is two-handed bowler Chaz Dennis of
Columbus, Ohio. He achieved this competing in the Hillcrest Preps-Juniors league at
Hillcrest Lanes in Columbus, Ohio on December 16, 2006, at 10 years, 88 days old. Dennis
was 20 days younger than the previous record-holder, Michael Tang of San Francisco,
California, who set his record when he was 10 years, 108 days old competing in the Daly
City All Stars Scratch Trios League at the Sea Bowl in Pacifica, California.[28]
Scoring may change from the above for high profile games, non-traditional games (like a 40
frame game), and variations of computer systems from age, manufacturer, or center
programming. Televised games score assumes strikes for unbowled frames as needed to score
bowled frames. The forty frame game gives bonus points and takes away points depending on
frame. Games bowled at the National level typically do not show detail on most shots. Some
computer systems will not tally scores if you string strikes to help control nerves. Most
scoring modifications are just extensions of the existing rules, and the end result is the same
once the game is complete.
Input
int noplayer
char nameofplayer1, nameofplayer2, nameofplayer3, nameofplayer4
int pinfall
int throw1,throw2,throw3
int finalscore
int score
char spare,strike
Output
Enter no of player: (Assume 1 player for this program analysis)
Enter name Player 1:
Please enter numbers of pin fall for each throw in a frame
Throw 1, Frame 1:
Throw 2, Frame 1:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F1:
Throw 1, Frame 2:
Throw 2, Frame 2:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F2:
Throw 1, Frame 3:
Throw 2, Frame 3:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F3:
Throw 1, Frame 4:
Throw 2, Frame 4:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F4:
Throw 1, Frame 5:
Throw 2, Frame 5:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F5:
Throw 1, Frame 6:
Throw 2, Frame 6:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F6:
Throw 1, Frame 7:
Throw 2, Frame 7:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F7:
Throw 1, Frame 8:
Throw 2, Frame 8:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F8:
Throw 1, Frame 9:
Throw 2, Frame 9:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Score F9:
Throw 1, Frame 10:
Throw 2, Frame 10:
Do you got strike <Y/N>:
Do you got spare <Y/N>:
Throw 3, Frame 10:
Score F10:
Final score for Player 1 is: