Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program using visual studio: The program is a bowling game: The objective: knock down as many pins with a ball. 1) Each

Create a C++ program using visual studio:

The program is a bowling game:

The objective: knock down as many pins with a ball.

1) Each game consists of 10 frames.

2) Frame is defined as:

a) Player gets 2 attempts per frame to knock down 10 pins.

b) Player rolls ball.

c) if player knocks down all 10 pins on 1st attempt, score for this frame is 10 plus the value of the next two rolls.

Therefore, score the frame cannot be computed until the next two rolls have been conducted. Utilize a frame score of 301 to check the result until the next two rolls have been conducted. There is no need for 2nd attempt. Game continues to next frame.

d1) if the player knocks down the remaining pins on the 2nd attempt, score for this frame is 10 plus the value of the next roll. Therefore, score the frame cannot be computed until the next roll has been conducted. Utilize a frame score of 301 to check the results until the next roll has been conducted.

d2) if the player does not knock down the remaining pins on the 2nd attempt, the score for this frame= 1st attempt + 2nd attempt.

After the 2nd attempt, game continues to next frame.

e) The score is cummulative i.e current score = pervious score + score for this frame. the testbench checks "the current score" for each frame.

3- game completes after 10 frames. final score is available as score of 10th frame in the testbench.

a) on the 10th frame, if player knocks down all the pins the 1st attempt, 2 additional rolls are provided. otherwise, if the player knocks down the remaining pins on the 2nd attempt, 1 additional is provided.

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

Step: 3

blur-text-image

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

Microsoft Visual Basic 2017 For Windows Web And Database Applications

Authors: Corinne Hoisington

1st Edition

1337102113, 978-1337102117

More Books

Students also viewed these Databases questions