I need help with this C coding project Got Talent Descriptio

I need help with this C++ coding project: Got Talent.

Description:

Write a C++ program to determine the winner of a talent contest. The contest has five judges, each of whom awards a score between 1 and 10 for each of the performers. Fractional scores are not allowed. A contestant’s final score is determined by dropping the highest and lowest scores received, then averaging the three remaining scores (the average should be rounded to two decimal places). The winner is the contestant with the highest average score. If there is a tie, the winner will be the first contestant judged.

Requirements:

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.

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.

Use function calcAvgScore that has the contestant’s 5 scores as input parameters

returns the average score for that contestant.

Calls two functions, findLowest and findHighest which both accept the 5 scores as input parameters and return the lowest and highest scores, respectively.

Do not use global variables. All variables used in the functions must be passed as parameters or declared locally.

At the end of the program, display the winner and winning score (rounded to 2 decimal places).

____________________________________________________________________________________________________________________________________________________________

I\'ve been racking my brains out trying to get this to compile correctly. If anyone could respond with a correct program so I can find out what I\'m doing wrong that would be great. I\'m only up to chapter six: functions in my c++ book (Starting out with C++ From control structures through Objects Eighth Edition- Tony Graddis) so anything more complicated than that is not very helpful at this point in time.

The output should look something like this. Thank you in advance for your help.

Solution


#include <stdio.h>
#include <iostream>

using namespace std;

int findHighest(int n1,int n2, int n3, int n4, int n5) {
   // Code for highest
   return 10;
}

int findLowest(int n1,int n2, int n3, int n4, int n5) {
   // Code for lowest
   return 1;
}

float calcAvgScore(int n1,int n2, int n3, int n4, int n5) {
   int high = findHighest(n1,n2,n3,n4,n5);
   int low = findLowest(n1,n2,n3,n4,n5);
   // Code for averaging the 3 numbers
   return 5;
  
  
}

int main() {
int i=0;
int n1,n2,n3,n4,n5;
int MAX=100;
int score[MAX];
char name[50][MAX];

char ch;
while( true) {
cout <<\"Please enter the name and scores of contester no \"<<i+1<<\">>>\";
   cin >> name[i]>>n1>>n2>>n3>>n4>>n5;
   score[i] = calcAvgScore(n1,n2,n3,n4,n5);
cout<<\"Press q to quit: Press p ENTER for another contestant\";
   cin>>ch;
   if(ch == \'q\') {
       break;
   }
  
   i++;
}
//Code for finding the winner // MAaximum of score
}

I need help with this C++ coding project: Got Talent. Description: Write a C++ program to determine the winner of a talent contest. The contest has five judges,
I need help with this C++ coding project: Got Talent. Description: Write a C++ program to determine the winner of a talent contest. The contest has five judges,

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site