Question: OBJECT-ORIENTED PROGRAMMING In the program to be written for teams, write the definition and functions of the classes, whose names are Team and Football (derived
OBJECT-ORIENTED PROGRAMMING
In the program to be written for teams, write the definition and functions of the classes, whose names are Team and Football (derived from the Team class), to be used to model teams (there should be 4 separate files and a main file). Team name must be string, team wins and loss count attributes must be integers. The constructor function must take the name of the team as a parameter and assign it to the corresponding attribute. The number of matches the football team has drawn, the number of goals scored and conceded must be integers. The constructor function transfers the parameters it takes to the name of the team and the other numerical values to the win, loss and draw characteristics respectively. There must be a member function that returns the total number of all matches played by the team. There should be a member function that returns the total score of the team, which is worth 3 points, draw: 1, loss: 0 points. There must be a member function that returns the team's average value, which is the difference between the number of goals scored and the number of goals conceded by the team. The operator> () function returns true if the sent football team is better than the calling football team, which is, the one with higher total score is better, if the scores are the same, the higher average is better. In the main function, create two Football objects with different initial values and test all member functions. Add your sample screen output to the source code folder.)
Hurry up please....
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
