Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A hospital is willing to keep track of the doctors and the patients each doctor is responsible for. As private information: A doctor has name,

A hospital is willing to keep track of the doctors and the patients each doctor is responsible for. As private information: A doctor has name, age, social security number as constant, office number, years of experience, and his/her patients; A patient has a name, age, and social security number as constant. Some patients are paying patients, for these patients we need to keep number of days stayed in the hospital, daily charge, and treatment charge.

a) Define the required classes and add to their public part the necessary functions to get and set the values of the private variables.

b) Add other public/friend functions to do the following tasks:

1) print function in each class, to print the characteristics in an organized (formatted) way. For instance, print the characteristics of a given patient in a form, each on a separate line with title on the left side and use "Patient Information" as the header of the form.

2) Read function in each class, to read values for the private variables.

3) A friend function of the paying patient class to calculate total expenses.

4) Two constructors in the patient class: 1. default constructor. 2. one constructor per private variable.

5) At least one constructor in the other classes.

6) The destructor of each class.

7) Write a general function where you read from a text file the information related to 3 doctors, 4 normal patients, 2 paying patients and 3 persons not in any of the three other categories.

Write a main to define some objects in the various classes and call the function in (7) to input the objects from the file (you decide on physical and local name of the file which should be text file). Write the objects in binary files, one per class, again decide on physical and logical names of the binary files.

please don't forget to include the file inside the code as it mentioned in part 7.

in c++ language

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 And Expert Systems Applications 31st International Conference Dexa 2020 Bratislava Slovakia September 14 17 2020 Proceedings Part 1 Lncs 12391

Authors: Sven Hartmann ,Josef Kung ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

303059002X, 978-3030590024

More Books

Students also viewed these Databases questions

Question

How to find if any no. is divisble by 4 or not ?

Answered: 1 week ago

Question

Explain the Pascals Law ?

Answered: 1 week ago