Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C++ program that computes the following: Description: The topic of this programming assignment is determining the gold-medal winner of a half-pipe snowboarding competition,

Create a C++ program that computes the following:

Description:

The topic of this programming assignment is determining the gold-medal winner of a half-pipe snowboarding competition, based on scores that are examples of actual data compiled and analyzed during the recent winter Olympic Games in South Korea. The name of all snowboarders and scores earned for one run are saved in a data file.

A snowboarders halfpipe run is scored as follows:

A team of six judges scores each halfpipe run. In the actual games, competitors had three runs to try to earn their very highest possible score. However, for this lab, the data for each snowboarder will reflect just their highest score, regardless on which run it occurred.

Each judge gives a subjective score from 1 to 100 based on overall impression, composed of height maintained throughout the run; variety and difficulty of maneuvers; and execution skill. (The six individual scores are not publicized, so we will have to make an assumption on data type.)

The highest and lowest scores of the six judges are dropped for the run.

Then, the four remaining scores are averaged, and the person with the highest average score wins the gold medal.

Instructions:

Assume that each judges score is an integer. For each of 3 snowboarders (will a loop be helpful with this?), you will be prompting the user to enter the following data on one line using the keyboard:

firstname lastname score1 score2 score3 score4 score5 score6

The user should be instructed to separate each data element by at least one space.

The first and last name of each snowboarder should be read in and stored in separate arrays named firstnames and lastnames. (If you want to practice more with strings, you may want to explore how to read in and save the whole name at one time and save it in an array called names.)

A loop should be used to read in and save scores for each snowboarder into an array of integers named scores. The snowboarder with the highest floating point average of four scores (see description above to understand which four scores) is the winner of the gold medal.

Complete the Problem Description, Input, Output, and Assumptions sections of a Lab Report. Decide on the tasks necessary for applying the rules to determine the gold medal winner. In the Algorithm section of your lab report, draw a decomposition diagram showing an overview of the main tasks required.

Below the decomposition diagram in your lab report, list the sequence in which tasks should be executed. This is not a detailed algorithm, simply a high-level sequence.

Include in the Example section of your lab report an example worked by hand, using the following sample data below (with a pretend mix of male/female USA athletes).

Name

Six judges scores

Avg (excluding min and max)

Sean White

96

98

88

99

98

100

97.75

Chloe Kim

92

99

100

98

99

97

98.25

Ben Ferguson

90

95

91

85

94

88

90.75

Write the code to determine the average score for each competitor. For each snowboarder, display a message stating the persons whole name and the average of that snowboarders four scores. This will help verify that your program works correctly for each person.

Finally, write the code to determine the gold medal-winning score. Display a message stating the winners whole name and average score.

Use the sample data to test your program and verify that actual results match expected results. In the Test Plan section of your lab report, document the first test case using the sample data, and also a screenshot of the execution results obtained using the sample data.

Next, construct a test case using test data of your own, and execute your program to verify that actual results match expected results. You may use your own choice of names (perhaps you and your friends?) and scores. Document your test data in the in the Test Plan section of your lab report, and include a screenshot of the execution results using your test data.

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

Refactoring Databases Evolutionary Database Design

Authors: Scott Ambler, Pramod Sadalage

1st Edition

0321774515, 978-0321774514

More Books

Students also viewed these Databases questions

Question

9. Understand the phenomenon of code switching and interlanguage.

Answered: 1 week ago