Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Define a class named Doctor which has 4 Data members Doc Name: a string type patient Names: a string array with a unlimatied size, use

Define a class named Doctor which has 4 Data members
Doc Name: a string type
patient Names: a string array with a unlimatied size, use it to save patient names . "dynamic array"
patient num: an integer type. represent the number of patient currently.
salary: a double data type
and methods:
Default constructor to the class,with patient_num=0,maximumnumberof patient =10.
a constructor Doctor (string doctorname, int maximumnumberof patient,double salary);
a method that displays an object's information. void printInfo();
a method to add patient' names. void addpatient names(string newpatientname);
Set and get methods for Doc_Name and Salary data members. (create set method to ensure the Doc Name data member contains a valid value; further assign a salary value that is positive)
Write your class in a separate file (interface & implementation files), you have to use a preprocessor directive.
Test your software in the main function:(open deriver file main.cpp)
Creates Doctor object named Doc1.
add patient names to the Doc1 object, use the (addpatient names method).
print the details of the Doc1 object .
image text in transcribed

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

Database Processing

Authors: David M. Kroenke

12th Edition International Edition

1292023422, 978-1292023427

More Books

Students also viewed these Databases questions

Question

What were some of the team roles at Casper?

Answered: 1 week ago

Question

Recognize the four core purposes service environments fulfill.

Answered: 1 week ago

Question

Know the three main dimensions of the service environment.

Answered: 1 week ago