Write a class called numberofgoals that represents the


Question: Write a class called NumberOfGoals that represents the total number of goals scored by a football team. The NumberOfGoals class should contain a single integer as instance data, representing the number of goals scored. Write a constructor to initialize the number of goals to zero. Write a method called setGoal that increments the value by one whenever a goal is scored, and another method called getGoal that returns the total number of goals scored so far. Finally, create a driver class called GoalTracker that creates a few NumberOfGoals objects and tests their methods.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: Write a class called numberofgoals that represents the
Reference No:- TGS02318579

Expected delivery within 24 Hours