Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ Putting it all together, Classes, Objects, Inheritance: Assignment Create a class called FitnessMember that has only one instance variable, called name. The person class

C++

Putting it all together, Classes, Objects, Inheritance: Assignment

Create a class called FitnessMember that has only one instance variable, called name. The person class should have a constructor with no parameters, a constructor with a parameter, a mutator function and an accessor function. Also, include a function to display the name.

Define a class called Athlete which is derived from FitnessMember. An Athlete class has the Athlete's name (inherited from the FitnessMember class) and ID number of type String.

Define a class called Trainer whose objects represent fitness centers trainers. Derive this class from the class FitnessMember as well. A Trainer object has the Trainer's name (inherited from the FitnessMember class) and a specialty as a String (for example, Weight, Aquatics, Cardio, Nutrition, etc.), and an training session fee (use the type double).

A Billing class will contain an Athlete object and a Trainer object.

Give all your classes a reasonable complement of constructors, and accessor and mutator functions.

Write a main test program that creates at least two Athletes, at least two Trainers, and at least two Billing records and displays the total income from the Billing records. Your tests should test all the functions and constructors defined in your program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Database Relational Model A Retrospective Review And Analysis

Authors: C. J. Date

1st Edition

0201612941, 978-0201612943

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago