1. Here is a soccerScore class that keeps track of the goals and shots taken by a soccer team. class soccerScore { priva

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Here is a soccerScore class that keeps track of the goals and shots taken by a soccer team. class soccerScore { priva

Post by answerhappygod »

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.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply