Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A particular talent composition has 5 judges, each of whom awards a score betwee

ID: 3765307 • Letter: A

Question

A particular talent composition has 5 judges, 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 lowest and the highest score received, then averaging the 3 remaining scores. Write a program that uses this method to calculate a contestant's score. It should include the following functions: double getJudgeData() should ask the user for a judge's score and validate the score. This function should be called 5 times from main, once for each of the 5 judges. void calcScore() should calculate and display the average of the three scores that remain after dropping the highest and lowest scores the performer received. This function should be called once from main, and should be passed the 5 scores. The last two functions, described below, should be called by calcScore, which uses the returned information to determine which of the scores to drop. double findLowest() should find and return the lowest of the five scores passed to it. double findHighest() should find and return the highest of the five scores passed to it. Input validation: Do not accept judge scores lower than 0 or higher than 10.

in C++ Micsrosft Visual Studio

Explanation / Answer

#include <cstdlib>
#include <iostream>

using namespace std;

double score1,score2,score3,score4,score5;
double minimum=0.0;
double maximum=0.0;

double findLowest();
double findHighest();
double getJudgeData()
{

double score=0.0;
cout<<"Enter Judge Score"<<endl;   
    cin>>score;
     
return score;   
     
}

void calcScore()
{

double final=((score1+score2+score3+score4+score5- findLowest()-findHighest() )/3);
cout<<"The Final score is "<<final<<endl;

   
}

double findLowest()
{
   minimum=score1;
if(score2<=minimum)
minimum=score2;
if(score3<=minimum)
minimum=score3;
if(score4<=minimum)
minimum=score4;
if(score5<=minimum)
minimum=score5;

  
return minimum;   
}

double findHighest()
{
    maximum=score1;
if(score2>=maximum)
maximum=score2;
if(score3>=maximum)
maximum=score3;
if(score4>=maximum)
maximum=score4;
if(score5>=maximum)
maximum=score5;

       
   return maximum;   
}



int main(int argc, char *argv[])
{
  
score1=getJudgeData();
score2=getJudgeData();
score3=getJudgeData();
score4=getJudgeData();
score5=getJudgeData();
    calcScore();

  
  
  
  
    system("PAUSE");
    return EXIT_SUCCESS;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote