1. Here is a soccerScore class that keepstrack of the goals and shots taken by a soccer team.
class soccerScore
{
private:
int goals;
int shots;
public:
soccerScore ();
void addGoal ();
void addShot ();
void print ();
};
a. Consider the implementationfile forthe soccerScore class. Define theconstructor which sets the valuesof goals and shots equalto zero.
b. Consider the implementationfile forthe soccerScore class. Define the memberfunction addGoal which increases thenumberof goals by 1.
c. Consider the applicationfile usingthe soccerScore class. Declarevariables Chelsea and ManU oftype soccerScore.
d. Consider the applicationfile usingthe soccerScore class. Make afunctioncall to addGoal for thevariable ManU.
1. Here is a soccerScore class that keeps track of the goals and shots taken by a soccer team. class soccerScore { priva
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am