Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve with C++ Problem: A hospital keep track of the Doctors and the Patients each doctor is responsible for. As private information: A doctor has

Solve with C++

image text in transcribed

Problem: A hospital keep track of the Doctors and the Patients each doctor is responsible for. As private information: A doctor has name, age, social security number and office number as constants, and a list of his/her patients: A patient has a name, age, and social security number as constants. For patients you also need to store number of days stayed in the hospital and daily charge. a) Define an abstract Person class that has virtual print() function for printing the information about a person b) Define Doctor and Patient classes as derived classes of Person. Add to their public part the necessary functions to get and set the values of the private variables. Use a static variable in Patient class to keep track of the total number of patients at the hospital. c) Add other public friend functions to do the following tasks: 1) print() function in each class, to print the data in an organized (formatted) way. For instance, print the information of a given patient in a .txt file, each information on a separate line with title on the left side and use "Patient Information" as the header of the form. 2) A friend function of the Patient class to calculate total expenses. 3) Two constructors in the Patient class: 1. default constructor: 2.one constructor for setting private variables. 4) The destructor of each class. When the patient leaves the hospital, the total hospital charge is printed on the screen and the corresponding patient object is destroyed. Write a test program to simulate the following scenario: Create a hospital with at least 3 doctors and 5 patients. Each doctor should have at least 2 patients. Simulate the treatment of patients for 10 days: Each day, patients are assigned random daily charges between 500 and 2000 TL. Each day, a patient can be assigned to multiple different doctors. o Patients can leave the hospital after a random number of days. At most 1 new patient arrives each day. At the end of each day, print the information of all patients at the hospital (including current total charges) into separate files (each day should be on a separate folder) 0 0

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 Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

Is there a link between chronic stress and memory function?

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago