Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

computer programming in c language Objectives : Apply the problem-solving process from initial problem analysis through code testing Use decomposition to identify main tasks, and

computer programming in c language

Objectives:

Apply the problem-solving process from initial problem analysis through code testing

Use decomposition to identify main tasks, and determine the correct sequence for the tasks in order to solve the problem

Practice using keyboard input to fill arrays

Practice using loops to process data in arraysusing common algorithms

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 dataon one line using the keyboard:

firstnamelastnamescore1 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 yourlab report, documentthe 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 usingtest 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 yourlab report, and include a screenshot of the execution results using your test data.

Deliverables:

Name your C program using the following pattern: yourFirstName_yourLastName_Lab2.c

Complete the sections of the Lab Report as instructed above, including both screenshots of execution results.

Upload both your C source code file and the Lab Report to the Piazza folder named Lab 2.

Scoring:Your grade for this assignment will be determined by four criteria:

Does your program compile and run, producing the correct results according to the instructions?

Does your program demonstrate good programming practices, such as well-documented code with comments, effective use of white space, proper indentation, appropriate variable names, etc.?

Are the required Lab Report sections complete and thoroughly documented?

Are you submitting your assignment on time?

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

Oracle RMAN For Absolute Beginners

Authors: Darl Kuhn

1st Edition

1484207637, 9781484207635

More Books

Students also viewed these Databases questions

Question

Would you rather ride a bike, ride a horse, or drive a car?

Answered: 1 week ago

Question

1-2 What are the six traits of professionalism? [LO-2]

Answered: 1 week ago