Question
create (with notepad application ) and copy the below data (not the captions) into a file nameReferees.txt IDFNameLNameGrade(dont copy this line) 0001MikeAppleCLUB 0012JoshBoeingSTATE 0103LindaIntelSTATE 0084JohnRambusNATIONAL
IDFNameLNameGrade(dont copy this line)
0001MikeAppleCLUB
0012JoshBoeingSTATE 0103LindaIntelSTATE 0084JohnRambusNATIONAL 0205BeckySiriusCLUB 0045TomSkyworksCLUB 0807KevinSuzukiNATIONAL 0074HenryXilinxSTATE
B.You are to write a program to do the followings:
1.Define a class namedCRefereeas defined in homework 12.
2.Define an enumeration typeRefereeGradeincluding 5 values UNKNOWN, CLUB, STATE, NATIONAL and FIFA (given) in the header file Referee.h.It should be before the definition of the classCReferee.
3.Then, create an array of 10 elements typedCReferee(in main file)
4.Create a menu with the following options:
a.List all referees
b.List all referees of a specific grade
c.List all referees with grade lower than a specific grade
d.List all referees with grade higher than a specific grade
e.List information of a specific referee using the Id
f.List information of a specific referee using the first and last names
g.Add a referee
h.Remove a referee using Id
i.Update referee grade using Id
j.Quit
5.Add a new functionreadRefereeInfo()to read the list of referees from the input fileReferees.txtinto the array of referees.This function should be called first inmain().See HW6 for references.
6.Add a new functionwriteRefereeInfo()to write the current information of the referees from the application to the fileReferees.txt.This function should be called in theQuitoption before terminating your application.The file is then updated with the latest information of the referees. See HW6 for references.
7.Copy HW6 functions of conversion between Grade and string to this project to use.
8.For option List all referees, only list the referees with the idNOT\"R000\".
9.For option List all referees with grade , ask for that specific grade and then use operators==,>orfor>
10.For option Add a referee, find an available slot (i.e. id is\"R000\").If there is one, ask new referee information (id, names, grade) and then insert the information into that slot.If there is no slot available, raise an error message and return to the menu.
11.For option Remove a referee, ask for referee id and then find him in the list.If found, reset the information with the default value: \"R000\", \"None\", \"None\", UNKNOWN for id, first name, last name and grade respectively.Otherwise, raise an error message and return to the menu.
12.For option Update referee grade, ask for referee id and then find him in the list.If found, ask for his new grade (cant be UNKNOWN).Then, update the grade for that referee. Otherwise, raise an error message and return to the menu.
Notes:You can add any supplemental functions for your convenience.
this is homework 12
Homework 12
1.You are to define an enumeration typeRefereeGradeincluding 5 values UNKNOWN, CLUB, STATE, NATIONAL and FIFA.
2.You are to write the definition for a class named CReferee.Followings are details for data members and member functions for the class:
Three public data members:
oID (string)
oFirst Name (string)
oLast Name (string)
One private data member:
oGrade (RefereeGrade)
One default constructor to initialize the data members to R000, None, None and UNKNOWN for ID, first name, last name and grade respectively.
One parameterized constructor to initialize the data members ID, first name, last name and grade to specific values.
A functiongetInfo() to get inputs for the information of a referee.
A functionshowInfo() to display the information of a referee as format:
ID First Last Grade.
Onemutatorand one accessor for the private data member.
3.Implement all of the member functions of the class CReferee. Then, use the following functionmain() as a sample to test all of member functions of the class.
voidmain()
{
CRefereefirstRef;
cout\"the>
firstRef.showInfo();
firstRef.getInFo();
cout\"the>
firstRef.showInfo();
cout\"modifying>
firstGame.setGrade(3.0);
cout\"the>
CRefereesecondRef(\"R0002\",\"Arby\",\"Sample\", CLUB);
cout\"the>
secondRef.showInfo();
cout\"modifying>
secondRef.setGrade(3.25);
cout\"the>
cout\"the>
secondRef.showInfo();
}
You should turn in 2 files (header and implementation) containing the source code of the class.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started