Question: Write in C++ Write a class named Cancer that has the following member variables: a. name. A string that holds the Cancer's name. b. id

Write in C++

Write a class named Cancer that has the following member variables:

a. name. A string that holds the Cancer's name.

b. id Number. An int variable that holds the Cancer's ID number.

c. affected_location. A string that holds the name of the affected_location where the Cancer is found.

d. Stage. A string that holds the Cancer's stage number.

The class should have the following constructors:

a. A constructor that accepts the following values as arguments and assigns them to the appropriate member variables:Cancer's name, Cancer's ID number, affected_location, and Stage.

b. A constructor that accepts the following values as arguments and assigns them to the appropriate member variables:Cancer's name and ID number.

c. The affected_location and Stage fields should be assigned an empty string ( );

d. A default constructor that assigns empty strings ( ) to the name, affected_location, and Stage member variables,and 0 to the id Number member variable.

Write appropriate mutator functions that store values in the member variables and accessor functions that return the values in these member variables.

Once you have written the class, create a three Cancer objects (3 separate instances), in your main function, to hold the following data.

Name

ID Number

affected_location

Stage

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!