Question
I need help with this program please: program requirements: 1. your program must declare the followingparallel arrays array to store the countrycodes array to store player names a two-dimensional array to store the judges'scores that each player received array to store total points for eachplayer 2. declare an array to store each judge'saverage score. 3. declare named constants (global) for thearray sizes(number of judges, number of countries. 4. no global variables areallowed 5. your program must read an input file nameinteractively. if file does not exist, print error massage and keepasking the user to enter another file name. 6. program must define and call thefollowing functions * void PrintPurpose(); * void GetPlayersInfo(char codes[], stringnames[], float scores[] [NUM_JUDGES], int size); //reads all players' info into parallel arrays and 2-d array from afile. * void ProcessScores(const float scores[][NUM_JUDGES], float averages[], int size); //Computes the total points for each player and store ina parallel array. * void ComputeAverages(const float scores[][NUM_JUDGES], float averages[], int size); //Computes the average score for each judge and store inan array * float FindHighest(const float scores[],int size) // Givenand array, finds and returns the largest value in thearray *float FindLowest(const float scores[], intsize) // Givenand array, finds and returns the smallest value in thearray *string ConvertCode(charcountryCode);
Explanation / Answer
please rate - thanks formatting is another post if you do post again please provide a copy and pasteable data file #include #include #include #define NUM_JUDGES 8 #define COUNTRYCODES 10 #define NUM_PLAYERS 3 using namespace std; void PrintPurpose(); void GetPlayersInfo(char[], string[], float[][NUM_JUDGES],int); void ProcessScores(const float[][NUM_JUDGES], float[], int); void ComputeAverages(const float[] [NUM_JUDGES], float[], int); float FindHighest(const float[][NUM_JUDGES], int); float FindLowest(const float[][NUM_JUDGES], int); string ConvertCode(char); int main() {int i,j; char codes[COUNTRYCODES]; string names[NUM_PLAYERS]; float scores[NUM_PLAYERS][NUM_JUDGES]; float tot[NUM_JUDGES]; float average[NUM_JUDGES]; string filename; int size=NUM_PLAYERS; PrintPurpose(); GetPlayersInfo(codes,names,scores,size); ProcessScores(scores,average,size); for(i=0;i