No. The return 0; is in the correct place in the OP.
The problem is the while statement.
while (quit == 0); // <- Note the semicolon
The semicolon terminates the while statement, effectively doing nothing. The following code executes exactly once since it is not under the control of the while statement.
Another question don't kill me! How would I keep each separate score value without combining into a total to drop lowest and highest to get average. Just asking how I would do this I was thinking array but cant get it right just an idea I do not want the answer given to me?
OK, I have to use a function to calculate and drop lowest / highest which I have used before just carrying the values is what I am asking not sure how to do this?
> OK, I have to use a function to calculate and drop lowest / highest which I have used before just carrying the values is what I am asking not sure how to do this?
well function would go
void calcAvg(int score1, int avg, int score2,) and so on
{
cout << avg << endl;
}
just something like that it will yake me some time to get th formula right you know but I will need each value to call and drop lowest / highest. I was looking for a way to not cin score1 , score2, ... I am sure there is a way?
oh the lowest and highest score will be dropped in the function and then averaged and compared to other contestants. hold on I will give you what I have
1. Input the contestant’s first name followed by the 5 judges’ scores. You do not know how many contestants there are. Design the loop so the loop terminates when you are finished entering contestants.
2. Input validation: Do not accept a judge’s score that is less than 1 or greater than 10. As each score is entered send the score to a function to test the score’s validity.
3. Use function calcAvgScore that has the contestant’s 5 scores as input parameters
a. returns the average score for that contestant.
b. Calls two functions, findLowest and findHighest which both accept the 5 scores as input parameters and return the lowest and highest scores, respectively.
4. Do not use global variables. All variables used in the functions must be passed as parameters or declared locally.
5. At the end of the program, display the winner and winning score (rounded to 2 decimal places).
I am really not asking you to do this assignment for me I just am not sure how to store the scores in a clean way.