Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++- The names of divers and their scores for a dive are stored in a file called DIV1.txt . Each diver's name is stored on

C++-

The names of divers and their scores for a dive are stored in a file called DIV1.txt . Each diver's name is stored on a line followed by that divers data for one dive. The data contains the difficulty factor of the dive and a score from each of 5 judges. Compute each divers total score by throwing out his/her low and high scores (do not change the order of the scores), averaging the remaining three scores, and then multiplying this average by the difficulty factor. Output each diver's name, his/her scores, and the total score for the dive arranged from the diver with the highest score to the lowest. Output is to be directed to a file.image text in transcribed

LAB #3 - Diving Competition Scoring a Diving Competition The names of divers and their scores for a dive are stored in a file called DIV1.txt. Each divers name is stored on 3 line followed by that diver's data for one dive. The data contains the difficulty factor of the dive and a score from each of 5 judges. Compute each diver's total score by throwing out his. her low and high scores (do not change the order of the scores), averaging the remaining three scores, and then multiplying this average by the difficulty factor Output each diver's name his her scores, and the total score for the dive arranged from the dim with the highest score to the lowest. Output is to be directed to a file The contents of DIV1.txt is to be: KNIFE JACK 1.3 6.0 5.1 6.3 5.9 6.5 WILLIAMSON FLIP A 1.4 3.5 4.1 4.7 7.2 3.3 SOMMER TODD 1.2 8.0 9.1 8.1 9.3 9.0 SWAN HIKE 1.1 4.3 2.1 9.5 6.2 7.0 Input: Assume a maximum of 50 divers Name of diver difficulty factor array for scores, and the total score for the dive should be members of a structure. The structure should contain a nested structure for difficulty factor, array of scores, and total score for dive. Each diver's structure needs to be an element of an array of structures. Processes: Computation of total score is to be handled in a separate function. A separate function should perform the sort using the bubble sort algorithm Output: Use a separate function for output. Output is to the deducted to a file. All functions need to include Pre and Post. Theme Issues: Array of strummers

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

Graph Databases In Action

Authors: Dave Bechberger, Josh Perryman

1st Edition

1617296376, 978-1617296376

More Books

Students also viewed these Databases questions

Question

=+Are the contracts enforceable?

Answered: 1 week ago