Question: Define a Date class containing three private attributes day, month, and year. Provide this class with a constructor allowing the initialization of its attributes. Date
Define a Date class containing three private attributes day, month, and year.
Provide this class with a constructor allowing the initialization of its attributes. Dateintint,intYou have to assign a default arguments for all parameters and deal with it ;
Provide a set and a get method for each data member.
Define a class named Doctor which has Data members
Doc Name: a string type
patientNames: 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
birthDate: object of date class.
and methods:
Default constructor to the class,with patientnummaximumnumberof patient
a constructor Doctor string doctorname, int maximumnumberof patient,double salary,Date BD
a method that displays an object's information. void printInfo;
a method to add patient' names. void addpatient namesstring 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
create a copyObject methode, void copyObjectDoctor anotherObject that copy values of data members in another object to the corresponding data members in the current object.
Write your class in a separate file interface & implementation files you have to use a preprocessor directive.
Scan your previous software, then convert all member methods you have to constant function members if you can, without changing its task.
Test your software in the main function:open deriver file main.cpp
Creates two Doctor object named DD
add patient names to the D object, use the addpatient names methodAmal Salwa,Deem
copy the values of D to D using copyObject Method.
print the details of the D object.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
