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.

you can use either c/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_2

Step: 3

blur-text-image_3

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 Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions

Question

Differentiate between hard and soft measures of service quality.

Answered: 1 week ago

Question

Be familiar with the different perspectives of service quality.

Answered: 1 week ago