Problem Solving with C++ (9th Edition)
Problem Solving with C++ (9th Edition)
9th Edition
ISBN: 9780133591743
Author: Walter Savitch
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 15, Problem 1PP

Solution to Programming Project 15.1

Give the definition of a class named Doctor whose objects are records for aclinic’s doctors. This class will be a derived class of the class SalariedEmployee given in Display 15.5. A Doctor record has the doctor’s specialty (such as “Pediatrician,” “Obstetrician,” “General Practitioner,” etc., so use type string) and office visit fee (use type double). Be sure your class has a reasonable complement of constructors, accessor, and mutator member functions, an overloaded assignment operator, and a copy constructor. Write a driver program to test all your functions.

Blurred answer
Students have asked these similar questions
Suppose, we have two related (child) classes named Doctor and Patient. Data membersrequired by each class are given below. data members of doctors name type remarks name string full name  of doctor age int age of person spec string speialization of doctor         data members of patient  name type remarks name string full name of person age int age of he person diag string diagnosed problem Using the information given above, create the following three classes. a. A parent class named Person containing common data members and functionality ofthe child classes; Doctor and Patientb. The class Doctor which is publicly inherited from the class Personc. The class Patient which is publicly inherited from the class Person Each class must contain at least two constructors in addition to the appropriate set() and show() functions. Functions of child classes should call appropriate functions of the parent class to perform the common functionality. All the function…
B)Create a class named 'Member' having the following members: Data members 1 - Name 2 - Age 3 - Phone number 4 - Address 5 - Salary It also has a method named 'printSalary' which prints the salary of the members. Two classes 'Employee' and 'Manager' inherits the 'Member' class. The 'Employee' and 'Manager' classes have data members 'specialization' and 'department' respectively. Now, assign name, age, phone number, address and salary to an employee and a manager by making an object of both of these classes and print the same.
Build a class Pet having the following data membersa. Name (String)b. Gender (char)c. Type (String)d. Age (int)e. Weight (float)f. healthCondition (int)Imagine this class Pet represents your pet as a virtualobject. Provide constructors with arguments for name,gender, type, age and weight. Initialize healthCondition to 5(which means healthy). Provide getter for each of these but setter for only weight. Provide a function eat(String food). This function represents the action of eating thatwould increase the weight of the pet according to following rulesFood Increase In WeightRed Meat 0.14 kgChicken 0.12 kgPet Food 0.17 kgSupplement 0.1 kgFish 0.09 kgThe eat function returns the new Weight of the pet object.Provide another function fallSick() that reduces the healthCondition of the pet 1 but it cannot gobelow 0. Provide a function bool isDead() this function returns true if the healthCondition of a pet is 0and false otherwise. Add another function recover(). This function increases…

Chapter 15 Solutions

Problem Solving with C++ (9th Edition)

Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY