Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help writing this C++ program: 1. Write a complete C++ program that takes the judges scores for a gymnastic event and finds each

I need help writing this C++ program:

1. Write a complete C++ program that takes the judges scores for a gymnastic event and finds each contestants score. It should satisfy all the following specifications: it first reads in an integer N that gives the number of judges. It then reads in a contestant number followed by N integers which are the scores given the contestant by the N judges. The scores should be read into an array, and then the program calls a function called findAverageScore that takes N and the array of judges scores as arguments. The function should find and drop the highest score and the lowest score, and then find and return the average of the remaining N-2 scores. The main should then print the contestant number and the average score s/he receives for the event to the screen. It will continue to do this (read in the contestant number, then the N integers, then print the contestant number and the calculated score on a new line) until a negative value is entered for the contestant number. The program will then print the contestant number who scored the highest. (You may assume no ties will occur.) All input will be from the keyboard and you may also assume that N will never be greater than 10 and never less than 3. You may format the output in any way as long as it is readable and correct, and you may assume all inputs are correct. (JUST WRITE CODE; NO DOCUMENTATION REQUIRED except for your NAME and ID at the start of the file!)

Name your program prob1.cpp. Submit it to the EPP - Problem 1 section on the class Titanium site. If you wrote more than one file containing code, make sure to send and copy them as well. Remember to put in your name and ID at the start of each file.

Sample output screen for a session (Bold numbers are printed by the program; normal numbers are typed in by the user.)

Number of Judges: 5 34 75376 Contestant 34 6 28 858107 Contestant 28 7.666666667 3 55344 Contestant 3 4.333333333

1 Contestant 28 had the highest score.

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

Enter the class ( capital letter ) for 1 6 1 . 9 6 . 2 4 . 2 3

Answered: 1 week ago

Question

=+ What is the role of government in bargaining?

Answered: 1 week ago

Question

=+ Who is the negotiation partner at company level?

Answered: 1 week ago