For Lab 7 you will use three parallel arrays to output the All Around winners of gymnastics competition.

For Lab 7 you will use three parallel arrays to output the All Around winners of gymnastics competition.

For Lab 7 you will use three parallel arrays to output the All Around winners of gymnastics competition.
INPUT
The data file you are to use is gymnasts.txt
Each line contains the following information for one gymnast:
String – name of gymnast (Store in the array for names)
Integer – age of gymnast (Store in the array for ages)
Double – score on vault (Add into sum for All Around score but do not store in an array)
Double – score on balance beam (Add into sum for All Around score but do not store in an array)
Double – score on bars (Add into sum for All Around score but do not store in an array) Double – score of floor (Add into sum for All Around score but do not store in an array)
Assume 100 is the maximum number of gymnasts.
Calculation (done in input function)
In a third one-dimensional array (type double) compute the gymnast’s All Around score by adding the scores for vault, balance beam, bars, and floor. This is best done in the input function.
In order to move the file pointer to the next gymnast you will really, really enjoy the following:
string temp;
getline(inFile,temp);//clear n or rl (Mac) before next string
OUTPUT:
Output 1: Output the name, age and All Around score for each gymnast. These should be in the following format and sorted by All Around score from high to low using selection sort. Output is to be to file
2017 USAIGC/IAGC WORLD CHAMPIONSHIPS
NAME     AGE  ALL AROUND
XXXXXXXXXXXXXXXXX            XX                         XX.XXX
Sample for output 1:
2017 USAIGC/IAGC WORLD CHAMPIONSHIPS
NAME     AGE  ALL AROUND
Isabella Alonzo  10     38.025
Amelia Aurelio   9     37.900
etc.

Output 2: Output the name and All Around score for each gymnast that is 10 years old. Output is to be to same file as for Output 1.
Sample for output 2:
2017 USAIGC/IAGC WORLD CHAMPIONSHIPS
NAME      ALL AROUND
Isabella Alonzo       38.025
Audrey Im            37.551
etc.
THEME ISSUES: one-dimensional arrays, nested loops, if statements, file input, file output
How should you do this?
STEP 1 Write main() and open file. Debug.
STEP 2 Write getdata(). At this stage there is a for loop to read each of five exercises inside a while not end of file type loop. Use debug cout statements to check that the data is being input correctly. These must be removed before final submission of project. Debug.
STEP 3 Add to getdata() computation to compute All Around score and store these values in the remaining (3rd) array of double values. Debug.
STEP 4 Write function to output heading. Debug.
STEP 5 Write output function. Debug.
STEP 6 Write function to sort using selection method. The call to this function will be placed before the output function calls. Debug.
STEP 7 Write separate function to output the names and All Around scores for all 10 yr old gymnasts.
STEP 8 “Doll up” the program documentation. Debug (just in case)
Checkpoint (alias rubric)  Possible
Include name, e-mail, and lab# as comment and printed to output 3
Minimum of three (3) comments in each function
(Purpose: Pre: Post:)
Input function fills name, age and All Around score 10
Use a selection sort to sort subject numbers. This needs to be a separate function.
A separate function must be used to output the table heading ONLY 2
Separate function to output name of each gymnast, age, and All Around score sorted from highest score to least is done in a separate output function. Output must be formatted as shown. Check that output is correct. Redirect output to a file.
Separate function to output all 10-yr old gymnast’s names and All Around score is printed to the file

"96% of our customers have reported a 90% and above score. You might want to place an order with us."

Essay Writing Service
Affordable prices

You might be focused on looking for a cheap essay writing service instead of searching for the perfect combination of quality and affordable rates. You need to be aware that a cheap essay does not mean a good essay, as qualified authors estimate their knowledge realistically. At the same time, it is all about balance. We are proud to offer rates among the best on the market and believe every student must have access to effective writing assistance for a cost that he or she finds affordable.

Caring support 24/7

If you need a cheap paper writing service, note that we combine affordable rates with excellent customer support. Our experienced support managers professionally resolve issues that might appear during your collaboration with our service. Apply to them with questions about orders, rates, payments, and more. Contact our managers via our website or email.

Non-plagiarized papers

“Please, write my paper, making it 100% unique.” We understand how vital it is for students to be sure their paper is original and written from scratch. To us, the reputation of a reliable service that offers non-plagiarized texts is vital. We stop collaborating with authors who get caught in plagiarism to avoid confusion. Besides, our customers’ satisfaction rate says it all.

© 2022 Homeworkcrew.com provides writing and research services for limited use only. All the materials from our website should be used with proper references and in accordance with Terms & Conditions.

Scroll to Top