EECE - CSCI 111 EECE 135 Programming Assignment#4 DUE...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CSCI 111 / EECE 135 Programming Assignment #4 DUE: Friday, March 16, 12:00 noon (system time at ect-unix.ecst.csuchico.edu ) I. The Next American Idol (Programming Challenge 6.9, p. 368) A. Overview For the next American Idol , a panel of 5 judges will be used, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and the lowest score received, then averaging the three remaining scores. B. Instructions Write a program that uses the score-calculation method described above to calculate a contestant's score. Your program should include the following functions: 1. void getJudgeData() should ask the user for a judge's score, store it in a reference parameter variable, and validate it. This function should be called by your function main() once for each of the 5 judges. 2. double calcScore() should calculate and return the average of the three scores that remain after dropping the highest and lowest scores the performer received. This function should be called once for each contestant by your function main() , and it should be passed the 5 scores from the judges. The following functions should be called by your calcScore() function, who uses the returned information to determine which of the scores to drop: 3. double findLowest() should find and return the lowest of the 5 scores passed to it. 4. double findHighest() should find and return the highest of the 5 scores passed to it.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Design your program with a loop so that after a contestant's score is determined, the user is asked if there is another contestant - the program repeats the whole process until the user indicates that there are no other contestants. (Assume that there is at least one contestant in the competition!) Your program should also keep track of contestant numbers (see sample session below) and the highest score received - upon termination, your program should report the winner based on the highest score calculated. (Note: Assume that calculated scores are unique and that there will be NO TIES. In case a high score is repeated, simply keep track of the first contestant with that high score.) Input Validation: Do not accept judge sores lower than zero or higher than 10. Save your C++ source code as
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/30/2008 for the course CS 643 taught by Professor Dr.fergany during the Fall '06 term at New Haven.

Page1 / 6

EECE - CSCI 111 EECE 135 Programming Assignment#4 DUE...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online