Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Homework requirements; 1. State the purpose of the program in one sentence. 2. Write the program in C++ language. 3. Use the comment line. 4.
Homework requirements; 1. State the purpose of the program in one sentence. 2. Write the program in C++ language. 3. Use the comment line. 4. Share the screenshot of the code output.
5. Please, don't copy paste, make the homework unique to you.
----------------------------------------------------------------------------
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 filesStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started