Question
The lab requires you to create two files patientAccount.cpp and accountDriver.cpp. You will end up with patientAccount.h, patientAccount.cpp and accountDriver.cpp. (50%) PatientAccount Class Definition: Class
The lab requires you to create two files patientAccount.cpp and accountDriver.cpp. You will end up with patientAccount.h, patientAccount.cpp and accountDriver.cpp. (50%)
PatientAccount Class Definition:
Class Account | |
Private Data Members: static int genId int patientID double balance int daysInHospital SurgeryType surType string name int age char gender | Static data member used to assign value to patientID; Account ID Current Balance of the patientAccount Number of days in hospital Type of surgery Name of Patient Age of Patient Gender of Patient |
Public Member Functions: PatientAccount() PatientAccount(int p_id, double bal, in daysInHospital,SurgeryType surType, string name, int age, char gender) | Constructors: Default Constructor (no parameters) Overloaded Constructor: Three-Parameter Constructor |
Public Member Functions: void setPatientId (int x) void setBalance(double x) void setDaysInHospital(int x) void setSurType(SurgeryType x) void setName(string x) void setAge(int x) void setGender(char x) | Setters: (Make sure input is validated) Function sets patient id to x. Function sets patient balance to x . Function sets days in hospital to x Function sets surgery type to x Function sets patient name to x Function sets patient age to x Function sets patient gender to x |
Public Member Functions: int getPatientId () double getBalance() int getDaysInHospital() SurgeryType getSurType() string getName() int getAge() char getGender() | Getters: Function returns patient ID. Function returns patient account balance . Function returns days in hospital. Function returns surgery type. Function returns patient name. Function returns patient age Function returns patient gender |
Public Member Functions: | |
double calculateBalance() | Function calculates and returns the patient account balance. |
void reportSummary() | Function displays a summary of all the patientAccount information. |
Write a program that creates an array of 5 PatientAccount objects.
Main Program: (35%)
The program should ask the user to select an account number from 0 – 5 or -1 to exit the program.
After selecting an account number, the user should be presented with the following menu options:
- Enter 1 to select the type of surgery performed
- Choices are Liposuction, Nose Reshaping, Eyelid Surgery and Tummy Tuck
- Enter 2 Calculate and Display the patient account balance
- Enter 3 Display the Patient Summary Report
- Enter 99 to exit to the main menu to select another account number
When creating each PatientAccount object, make sure that each object is initialized in both the default and overloaded constructor functions with the following guidelines:
- Use the static data member to initialize the patientID. Patient ID must be initialized with multiples of 100 starting with 100. (5%)
- The starting balance of each PatientAccount object should be created from a random number generator function returning values between 100.00 and 2000.00. (5%)
- Use: enum SurgeryType {LIPOSUCTION,NOSE_RESHAPING,EYELID_SURGERY,TUMMY_TUCK}; (5%)
- The cost of surgery types is as follows:
- Liposuction = $2,500.00
- Nose Reshaping = $6,000.00
- Eyelid Surgery = $2,450.00
- Tummy Tuck = $12,900.00
- NOTE: No non-constant global variables are to be used in the program
No input given!!!!!!!!
#ifndef patientAccount_h 10 #define patientAccount_h 11 #include 12 13 class PatientAccount 14 { 15 private: 16 static int genId; int patientID; 18 double balance; 19 int daysInHospital; 17 20 std::string surType; 21 std::string name; int age; 23 char gender; 22 24 25 public: 26 PatientAccount (); 27 PatientAccount (int p_id, double bal, int daysInHospital, std::string surType, std::string name, int age, char gender) ; 28 void setPatientId (int x); 29 void setBalance (double x); 30 void setDaysInHospital(int x); 31 void setSurType(std::string x); 32 void setName (std::string x); 33 void setAge (int x); 34 void setGender (char x); 35 36 int getPatientId (); 37 double getBalance (); 38 int getDaysInHospital(); 39 std::string getSurType(); 40 std::string getName (); int getAge (); char getGender (); 43 static double getGenId(); 44 double calculateBalance(); 45 void reportSummary (); 41 42 46 47 }; 48 #endif /* patientAccount_h */ 49
Step by Step Solution
There are 3 Steps involved in it
Step: 1
PatientIDjava Sample Run 1 public class PatientID static int Pati...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