Question: C++ Program: Write a program to calculate a bowling league's average bowling scores. You will need to read the input data from the file BowlingScores.txt

C++ Program:

Write a program to calculate a bowling league's average bowling scores. You will need to read the input data from the file BowlingScores.txt (Note: The file format is guaranteed to remain the same.)

You must use three arrays:

a one-dimensional array to store the bowler's names.

a (parallel) two-dimensional array to store the bowling scores.

a one-dimensional array to store the bowler's average score.

Your program must contain at least the following functions:

a function called GetBowlingData to read and store data into two arrays. The function should take as input parameters the file name and both empty arrays, which it should fill from the file (BowlingScores.txtC++ Program: Write a program to calculate a bowling league's average bowling) and return a status of either success or failure (i.e true or false).

a function called GetAverageScore that is used to calculate the average bowling score. The function should take as input the populated arrays and return the average score of each bowler in a separate array.

a function called PrettyPrintResults to output the results, i.e. bowler name, scores and average.

Don't use Vectors or any other newfangled container, use only old school C arrays like in the book.

Use repetition structures (loops) in your functions to perform calculations and printing. Remember "dimensions = loops". So a 2 dimensional array will require 2 loops to completely iterate over all of the elements in the array.

And as always, don't use magic numbers. Instead use global constants at the top of the program under the includes. Input data present within the BowlingScores.txt file for use in program:

JoJo 185 203 177 45

BBilly 180 90 195 293

ACooper 178 281 111 90

LGupta 192 283 30 169

RBlake 23 45 96 38

McClark 160 185 145 139

Sunny 77 31 52 74

Sammy 93 94 289 277

AliceB 279 185 128 93

MikeSmith 85 72 49 75

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!