Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

programming2 (C++) please do it clearly A struct called Person that has the components first and last (of type string). A class called Doctor with

programming2 (C++)
please do it clearly
image text in transcribed
A struct called Person that has the components first and last (of type string). A class called Doctor with the private data members name (of type Person), degree (of type string) and salary (of type integer). The class has the public member functions set(), getSalary (), print() and a default parameterize constructor. Define a class called Master which publicly inherits the class Doctor and has the private data members specialty (of type string), rarity and salary (both of type integer). The class has the public member functions set 0 , prin00. findSalary 0 and a default parameterize constructor. The overall salary of a Master is the sum of rarity and the salary of a Doctor. Implement the member functions of both classes. Use one header file, one implementation file, and one driver file. The following driver produces the given output: int main0 Master Omar, Omar.set("Ali", "Omar", "Dermatologist", 12000, "Pathologists", 4000); Omar.print(); return 0 ; 1 Sample output: Dr. Al1 Omar has a Dermatologist degree and his/her salary is 12000 He/she is specialized in Pathologists and his/her total salary is 16eee The first line of the above output produced by the print 0 function of the class Doctor

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_2

Step: 3

blur-text-image_step3

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

More Books

Students explore these related Databases questions