Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions