/Please Fix this probem. #include #include Class Soccer { Int g_no, no_assist, no_goal; Public : soccer () { j_no=0; No_assist=0; No_goal=0; } Void read () { Cout<<”Enter the player information (no of jersey, no of goals and no of assists):”; Cin>>j_no>>no_goal>>no_assist; } void display () { Cout<<”The information of best scorer player is :” Cout<<”Jersery no of player:”<(Soccer P) { Soccer temp; If((no_assist + no_goals )>(y.no_assist + y.no_goals)) { Temp.j_no=j_no; Temp.no_assist=no_assist; Temp.no_goal=no_goal; } Else { Temp.j_no=j_no; Temp.no_assist=y.no_assist; Temp.no_goal=y.no_goal; } Return(temp); } Void main () { Soccer P[11],L; Int I; For(i=0;i<=11;i++) { P[i].read(); } L=p[0]; For(i=1;i<=11;i++) { L=L>P[i]; } L.display(); getch(); }
//Please Fix this probem.
#include <iostream.h>
#include<conio.h>
Class Soccer
{
Int g_no, no_assist, no_goal;
Public :
soccer ()
{
j_no=0;
No_assist=0;
No_goal=0;
}
Void read ()
{
Cout<<”Enter the player information (no of jersey, no of goals and no of assists):”;
Cin>>j_no>>no_goal>>no_assist;
}
void display ()
{
Cout<<”The information of best scorer player is :”
Cout<<”Jersery no of player:”<<j_no;
Cout<<”No of goals :”<<no_goal;
Cout<<”No of assists :”<<no_assist;
}
Soccer operator >(Soccer P)
{
Soccer temp;
If((no_assist + no_goals )>(y.no_assist + y.no_goals))
{
Temp.j_no=j_no;
Temp.no_assist=no_assist;
Temp.no_goal=no_goal;
}
Else
{
Temp.j_no=j_no;
Temp.no_assist=y.no_assist;
Temp.no_goal=y.no_goal;
}
Return(temp);
}
Void main ()
{
Soccer P[11],L;
Int I;
For(i=0;i<=11;i++)
{
P[i].read();
}
L=p[0];
For(i=1;i<=11;i++)
{
L=L>P[i]; }
L.display();
getch(); }
Step by step
Solved in 2 steps with 3 images