Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is C++ problem needs to be compiled with GNU C++ Compiler. The required file bowling.txt ( Fred Blue 20 Harry Blue 35 Tony White
This is C++ problem needs to be compiled with GNU C++ Compiler. The required file bowling.txt (
Fred Blue 20 Harry Blue 35 Tony White 43 Hilda Blue 12 Paul White 34 Tom White 20 )
Write a program in a file named Bowling.cpp that uses parallel arrays to store information that is on each line of the input file bowling.txt. Each line of that file contains a bowling team member's first name (string), one of two bowling team names (string data equal to either "Blue" or "White), and that bowling team member's score in a bowling match (int). Each line of the file contains a unique bowling team member so that you do not need to worry about repeated team member's names or embedded blanks within the field. Also, each team is guaranteed to have the same number of team members. Your program should use a function to sum the scores of each of the two teams. Once you determine the maximum score, your program should display on the monitor a message as to which team won and then use a function to display each of the winning team member's name and score. The parallel array strategy implies that you will need 2 arrays of type string for the team member's name and 2 arrays of type int for the team member's score Variables (no global variables allowed) member, team, score First name of team member (no embedded spaces), team (either Blue or White), and score blue_members, white_members arrays storing team member names blue scores, white scores arrays storing team member scores Accumulator variables (one for each team) to count the number of team members read from file into array Input bowling.txt Read team member, team and score from bowling.txt Format of bowling.txt cmember
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started