Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED HELP BAD FOR THIS LAB!!!! We've only convered #include ,iostream,string, and cmath 1. You must use a vector to store all of the player

NEED HELP BAD FOR THIS LAB!!!!

We've only convered #include ,iostream,string, and cmath

1. You must use a vector to store all of the player names. All player names will be a single name.

2. You must use another vector to store the total score for each player. You must calculate the total score for each player after all rolls have been entered.

3. You must use an array to store each roll's value.

4. The number of rolls is variable depending on whether the player threw a strike (knocked down 10 pins in one roll), spare, or neither. Please see "Scoring Bowling" below.

5. You must use a for loop to input the roll values into the array.

6. If the user types "done" before entering any names, output "No players were entered."

7. In the event of a tie, the first player to obtain the best or worst score should be printed.

8. You can assume that the user will input valid scores. You do not need to perform error checking for invalid input.

image text in transcribed

image text in transcribed

Enter player's name (done for no more players): John Enter score for frame 1, roLL 1: 10 Enter score for frame 2, roll 1: 10 Enter score for frame 3, roll 1: 10 Enter score for frame 4, roll 1: 10 Enter score for frame 5, roll 1: 10 Enter score for frame 6, roll 1: 10 Enter score for frame 7, roll 1: 10 Enter score for frame 8, roll 1: 10 Enter score for frame 9, roll 1: 10 Enter score for frame 10, roll 1: 10 Enter score for frame 10, roll 2: 10 Enter score for frame 10, roll 3: 10 Enter player's name (done for no more players): Cheryl Enter score for frame 1, roll 1: 8 Enter score for frame 1, roll 2: 1 Enter score for frame 2, roll 1: 0 Enter score for frame 2, roll 2: 9 Enter score for frame 3, roll 1: 2 Enter score for frame 3, roll 2: 8 Enter score for frame 4, roll 1: 10 Enter score for frame 5, roll 1: 6 Enter score for frame 5, roll 2: 3 Enter score for frame 6, roll 1: 7 Enter score for frame 6, roll 2: 0 Enter score for frame 7, roll 1: 5 Enter score for frame 7, roll 2: 2 Enter score for frame 8, roll 1: 10 Enter score for frame 9, roll 1: 0 Enter score for frame 9, roll 2: 6 Enter score for frame 10, roll 1: 2 Enter score for frame 10, roll 2: 8 Enter score for frame 10, roll 3: 10 Enter player's name (done for no more players): done John scored 300 Cheryl scored 122 Cheryl did the worst by scoring 122. John won the game by scoring 300 Enter player's name (done for no more players): done No players were entered

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2014 Nancy France September 15 19 2014 Proceedings Part 2 Lnai 8725

Authors: Toon Calders ,Floriana Esposito ,Eyke Hullermeier ,Rosa Meo

2014th Edition

3662448505, 978-3662448502

More Books

Students also viewed these Databases questions