Question: You are to: Define and implement extraction and insertion operators similar to 2 functions getInfo ( 0 and showInfo ( ) for the 2 classes

You are to:
Define and implement extraction and insertion operators similar to 2 functions getInfo(0 and showInfo() for the 2 classes defined in the homework 10 and 12.
Modify your function main() of homework 12 to use to these 2 new operators instead.
Re-run your updated function main() to see if it works.
You should turn in:
- The source code of:
the class definitions
the class implementations
the main function.
- The output. You are to:
Define and implement extraction and insertion operators similar to 2 functions getInfo(0 and showInfo() for the 2 classes defined in the homework 10 and 12.
Modify your function main() of homework 12 to use to these 2 new operators instead.
Re-run your updated function main() to see if it works. Referee.cp
\(\underbrace{+}\) HW 12
```
#pragma once
#include
#include
#include
using namespace std;
` enum RefereeGrade
{
UNKNOWN,
CLUB,
STATE,
NATIONAL,
FIFA
};
` class CReferee {
public:
string Id;
string firstName;
string lastName;
CReferee(){
Id ="R000";
firstName = "None";
lastNane = "None";
Grade = UNKNOWN;
}
CReferee(string id, string fName, string lName, RefereeGrade grade){
Id = id;
firstName = fName;
lastWame = lName;
Grade = grade;
}
void getInfo(){
cout "Enter ID: ";
cin \gg> Id;
cout "Enter First Name: ";
cin >> firstName;
cout "Enter Last Name: ";
cin >> lastName;
cout "Enter Grade (0 for UNKNOWN, 1 for CLUB, 2 for STATE, 3 for NATIONAL, 4 for FIFA): "
int tempGrade;
cin >> tempGrade;
Grade = static_cast(tempGrade);
}
void showInfo(){
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout.precision(2);
cout \ll setw(10) Id
setw(10) firstWame
setw(10) last\lame setw(10) Grade endl;
}
void setGrade(RefereeGrade grade){
Grade = grade;
}
RefereeGrade getGrade(){
return Grade;
}
private:
RefereeGrade Grade;
};
```
```
|` #include "Referee.h"
#include
using namespace std;
` int main()
{
CReferee firstRef;
cout "The default information of the first ref:
";
firstRef.showInfo();
firstRef.getInfo();
cout "
";
cout "The inputted information of the first ref:
";
firstRef.showInfo();
cout "
";
cout "Modifying the grade to NATIONAL.
";
firstRef.setGrade(NATIONAL);
cout "The referee grade is now: " firstRef.getGrade() endl;
CReferee secondRef("R0002", "Arby", "Sample", CLUB);
cout "
";
cout "The initial information of the second ref:
";
secondRef.showInfo();
cout "
";
cout "Modifying the grade to STATE.
";
secondRef.setGrade(STATE);
cout "The modified grade is now: " secondRef.getGrade() endl;
cout "
";
cout "The updated information of the second ref:
";
secondRef.showInfo();
return 0;
```
You are to: Define and implement extraction and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!