Question: please help on parts that says put your code here initializeReflist ( ) ; readRefereeInfo ( ) ; int choice; do { system (
please help on parts that says "put your code here"
initializeReflist;
readRefereeInfo;
int choice;
do
systemCLS;
choice menu;
switch choice
case :
listAllReferees;
break;
case :
listRefereesOfSpecificGrade;
break;
case :
Quit;
break;
default:
cout "That was an invalid choice, please try again!
;
systemPAUSE;
while choice && choice ;
systemPAUSE;
return ;
int menu
int option;
cout REFEREE SYSTEM
;
cout List All Referees.
;
cout List All Referees of A Specific Grade.
;
cout Quit.
;
cout "Please select your option: ;
cin option;
while option option
cout "Invalid option!!! Please select valid option: ;
cin option;
return option;
void initializeReflist
SReferee defaultRef UNKNOWN ;
for int i ; i REFEREELISTSIZE; i
refereesi defaultReoverlinef;
void listAllReferees
i;
if found
cout NO Referees found!!!" endl;
void Quit
Write Referee information back from the referee array to the file Referees.txt
writeRefereeInfo;
cout "Have a nice day
;
void readRefereeInfo
Read Referee information from the file Referees.txt to the referee array
ifstream inFile;
inFile.openRefereestxt;
if inFilefail
cout "Error open the input file... Exiting
;
exit;
string tempStr;
int i ;
while inFile refereesiid
Add your code here to
read from the file Referees.txt the grade as the to the tempStr
convert the grade in string to grade in RefereeGrade
then assign the converted grade to the refereesigrade
refereesigrade stringToGradetempStr;
i;
inFile.close;
void writeRefereeInfo
ofstream outFile;
outFile.openRefereestxt;
if outFilefail
cout "Error open the output file... Exiting
;
exit;
int i ;
while i REFEREELISTSIZE
if refereesiid
outFile refereesiid t;
Add your code here to
convert the grade in RefereeGrade to the corresponding string
write the converted string to the file Referees.txt
outFile endl;
i;
outFile.close;
string gradeToStringRefereeGrade g
switch g
case CLUB:
return "CLUB";
case STATE:
return "STATE";
case NATIONAL:
return "NATIONAL";
case FIFA:
return "FIFA";
default:
return "UNKNOWN";
RefereeGrade stringToGradestring s
if s "CLUB"
return CLUB;
else if s "STATE"
return STATE;
else if s "NATIONAL"
return NATIONAL;
else if s "FIFA"
return FIFA;
else
return UNKNOWN;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
