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

I need help to modify C++ program question: In an international gymnastic compet

ID: 3617901 • Letter: I

Question

I need help to modify C++ program
question: In an international gymnastic competition, eachcontestant's score is calculated by dropping the lowest and highestscores and then adding the remaining scores. Write a program theatallows the user to enter a player's id followed by the nationalityand eight judges' scores. There are 5 contries entered for thiscompetition and each country is represented by one character. Thecountry codes are A for America, C for China, M for Mexico, B forBrazil, and F for France. a judge awards points between 1 and10, with 1 being a lowest and 10 being the highest. Format youroutput with two decimal places.
requirements: your program must define and call thefollowing functions 1.void PrintPurpose();    //prints the purpose of program 2. int GetId(); //Prompts,reads andreturns an id. checks for invalid input(do-while) 3. char GetCode(); //prompts,reads andreturns a cod. checks for invalid input(do-while) 4. void ReadAllScores(float scores[], int size) //reads all judge's score, checks for invalidinput(do-while) 5. void ReadOneScore(float& score); //reads a judge's score. checks for invalidinput(do-while) 6. float ProcessScores(const float scores[], int size);// computes the points recieved by acontestant. calles functions FindHighest andFindLowest. 7. void PrintResult(float points, int id, char countryCode);// prints the result. calls function ConvertCode. 8. float FindHighest(const float scores[], int size);//Given an array, finds and returns thelargest value in the array. 9. float FindLowest(const float scores[], int size);//Given an array, finds and returns thesmallest value in the array. 10. string ConvertCode(char CountryCode); // given a country code character, return itscorresponding string(switch statement)
this is the code: #include <iostream>
#include<iomanip> const int SIZE= 8;
using namespace std;
int main()
{int id,i;
char country;
double score[SIZE],sum=0,max=0,min=50;
cout<<"Enter the player id: ";
cin>>id;
while(id<111||id>999)
   {cout<<"The player id must be between 111 and999. ";
    cout<<"Enter the player id: ";
    cin>>id;
    }
cout<<"Enter the country code: ";
cin>>country;
while(country!='A'&&country!='B'&&country!='C'&&country!='F'&&country!='M')
    {cout<<"Invalid country code. ";
     cout<<"Enter the country code:";
     cin>>country;
     }
for(i=0;i<SIZE;i++)
    {cout<<"Enter a judge's score: ";
    cin>>score[i];
    while(score[i]<1||score[i]>10)
        {cout<<"Score mustbe between 1.0 and 10.0 ";
         cout<<"Entera judge's score: ";
        cin>>score[i];
         }
     if(score[i]<min)
         min=score[i];
      if(score[i]>max)
         max=score[i];
     sum+=score[i];
     }
sum=sum-min-max;
cout<<"******************************** ";
switch(country)
   {case 'A': cout<<"American ";
             break;
   case 'B': cout<<"Brazilian ";
             break;
   case 'C': cout<<"Chinese ";
             break;
    case 'F': cout<<"French ";
             break;
    case 'M': cout<<"Mexican ";
    }
cout<<" player "<<id<<" received"<<fixed<<showpoint<<setprecision(2)<<sum<<"points ";
system("pause");
return 0;
}

sample run:
Enter the player id: 12
The player id must be between 111 and 999.
Enter the player id: 134
Enter the country code: D
Invalid country code.
Enter the country code: A
Enter a judge's score: 0.5
Score must be between 1.0 and 10.0
Enter a judge's score: 9.0
Enter a judge's score: 9.3
Enter a judge's score: 9.0
Enter a judge's score: 9.9
Enter a judge's score: 9.5
Enter a judge's score: 9.4
Enter a judge's score: 9.6
Enter a judge's score: 9.8
********************************************************
American player 134 received 56.80 points. I need help to modify C++ program
question: In an international gymnastic competition, eachcontestant's score is calculated by dropping the lowest and highestscores and then adding the remaining scores. Write a program theatallows the user to enter a player's id followed by the nationalityand eight judges' scores. There are 5 contries entered for thiscompetition and each country is represented by one character. Thecountry codes are A for America, C for China, M for Mexico, B forBrazil, and F for France. a judge awards points between 1 and10, with 1 being a lowest and 10 being the highest. Format youroutput with two decimal places.
requirements: your program must define and call thefollowing functions 1.void PrintPurpose();    //prints the purpose of program 2. int GetId(); //Prompts,reads andreturns an id. checks for invalid input(do-while) 3. char GetCode(); //prompts,reads andreturns a cod. checks for invalid input(do-while) 4. void ReadAllScores(float scores[], int size) //reads all judge's score, checks for invalidinput(do-while) 5. void ReadOneScore(float& score); //reads a judge's score. checks for invalidinput(do-while) 6. float ProcessScores(const float scores[], int size);// computes the points recieved by acontestant. calles functions FindHighest andFindLowest. 7. void PrintResult(float points, int id, char countryCode);// prints the result. calls function ConvertCode. 8. float FindHighest(const float scores[], int size);//Given an array, finds and returns thelargest value in the array. 9. float FindLowest(const float scores[], int size);//Given an array, finds and returns thesmallest value in the array. 10. string ConvertCode(char CountryCode); // given a country code character, return itscorresponding string(switch statement)
this is the code: 1.void PrintPurpose();    //prints the purpose of program 2. int GetId(); //Prompts,reads andreturns an id. checks for invalid input(do-while) 3. char GetCode(); //prompts,reads andreturns a cod. checks for invalid input(do-while) 4. void ReadAllScores(float scores[], int size) //reads all judge's score, checks for invalidinput(do-while) 5. void ReadOneScore(float& score); //reads a judge's score. checks for invalidinput(do-while) 6. float ProcessScores(const float scores[], int size);// computes the points recieved by acontestant. calles functions FindHighest andFindLowest. 7. void PrintResult(float points, int id, char countryCode);// prints the result. calls function ConvertCode. 8. float FindHighest(const float scores[], int size);//Given an array, finds and returns thelargest value in the array. 9. float FindLowest(const float scores[], int size);//Given an array, finds and returns thesmallest value in the array. 10. string ConvertCode(char CountryCode); // given a country code character, return itscorresponding string(switch statement)
this is the code: #include <iostream>
#include<iomanip> const int SIZE= 8;
using namespace std;
int main()
{int id,i;
char country;
double score[SIZE],sum=0,max=0,min=50;
cout<<"Enter the player id: ";
cin>>id;
while(id<111||id>999)
   {cout<<"The player id must be between 111 and999. ";
    cout<<"Enter the player id: ";
    cin>>id;
    }
cout<<"Enter the country code: ";
cin>>country;
while(country!='A'&&country!='B'&&country!='C'&&country!='F'&&country!='M')
    {cout<<"Invalid country code. ";
     cout<<"Enter the country code:";
     cin>>country;
     }
for(i=0;i<SIZE;i++)
    {cout<<"Enter a judge's score: ";
    cin>>score[i];
    while(score[i]<1||score[i]>10)
        {cout<<"Score mustbe between 1.0 and 10.0 ";
         cout<<"Entera judge's score: ";
        cin>>score[i];
         }
     if(score[i]<min)
         min=score[i];
      if(score[i]>max)
         max=score[i];
     sum+=score[i];
     }
sum=sum-min-max;
cout<<"******************************** ";
switch(country)
   {case 'A': cout<<"American ";
             break;
   case 'B': cout<<"Brazilian ";
             break;
   case 'C': cout<<"Chinese ";
             break;
    case 'F': cout<<"French ";
             break;
    case 'M': cout<<"Mexican ";
    }
cout<<" player "<<id<<" received"<<fixed<<showpoint<<setprecision(2)<<sum<<"points ";
system("pause");
return 0;
}

sample run:
Enter the player id: 12
The player id must be between 111 and 999.
Enter the player id: 134
Enter the country code: D
Invalid country code.
Enter the country code: A
Enter a judge's score: 0.5
Score must be between 1.0 and 10.0
Enter a judge's score: 9.0
Enter a judge's score: 9.3
Enter a judge's score: 9.0
Enter a judge's score: 9.9
Enter a judge's score: 9.5
Enter a judge's score: 9.4
Enter a judge's score: 9.6
Enter a judge's score: 9.8
********************************************************
American player 134 received 56.80 points. Enter the player id: 12 The player id must be between 111 and 999. Enter the player id: 134 Enter the country code: D Invalid country code. Enter the country code: A Enter a judge's score: 0.5 Score must be between 1.0 and 10.0 Enter a judge's score: 9.0 Enter a judge's score: 9.3 Enter a judge's score: 9.0 Enter a judge's score: 9.9 Enter a judge's score: 9.5 Enter a judge's score: 9.4 Enter a judge's score: 9.6 Enter a judge's score: 9.8 ******************************************************** American player 134 received 56.80 points.

Explanation / Answer

please rate - thanks #include #include using namespace std; void PrintPurpose();    //prints the purpose ofprogram int GetId(); //Prompts,reads and returns an id. checks for invalidinput(do-while) char GetCode(); //prompts,reads and returns a cod. checks forinvalid input(do-while) void ReadAllScores(float scores[], int size); //reads all judge'sscore, checks for invalid input(do-while) void ReadOneScore(float& score); //reads a judge's score.checks for invalid input(do-while) float ProcessScores(const float scores[], int size); // computesthe points recieved by a contestant. calles functions FindHighestand FindLowest. void PrintResult(float points, int id, char countryCode); // printsthe result. calls function ConvertCode. float FindHighest(const float scores[], int size); //Given anarray, finds and returns the largest value in the array. float FindLowest(const float scores[], int size); //Given an array,finds and returns the smallest value in the array. string ConvertCode(char CountryCode); // given a country codecharacter, return its corresponding string(switch statement) const int SIZE= 8; int main() {int id,i; char country; float score[SIZE],sum=0,max,min; PrintPurpose(); id=GetId(); country=GetCode(); ReadAllScores(score,SIZE); sum=ProcessScores(score,SIZE); max=FindHighest(score,SIZE); min=FindLowest(score,SIZE); cout
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