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 functions getInfo and showInfo for the classes defined in the homework and
Modify your function main of homework to use to these new operators instead.
Rerun 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 functions getInfo and showInfo for the classes defined in the homework and
Modify your function main of homework to use to these new operators instead.
Rerun your updated function main to see if it works. Referee.cp
underbrace HW
#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 R;
firstName "None";
lastNane "None";
Grade UNKNOWN;
CRefereestring 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 for UNKNOWN, for CLUB, for STATE, for NATIONAL, for FIFA:
int tempGrade;
cin tempGrade;
Grade staticcasttempGrade;
void showInfo
cout.setfios::fixed;
cout.setfios::showpoint;
cout.precision;
cout ll setw Id
setw firstWame
setw lastlame setw Grade endl;
void setGradeRefereeGrade 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.setGradeNATIONAL;
cout "The referee grade is now: firstRef.getGrade endl;
CReferee secondRefR "Arby", "Sample", CLUB;
cout
;
cout "The initial information of the second ref:
;
secondRefshowInfo;
cout
;
cout "Modifying the grade to STATE.
;
secondRefsetGradeSTATE;
cout "The modified grade is now: secondRefgetGrade endl;
cout
;
cout "The updated information of the second ref:
;
secondRefshowInfo;
return ;
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
