Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The code in the following files: patientAccount.cpp accountDriver.cpp patientAccount.h Please use these file names exactly. Summary The lab requires you to create two files patientAccount.cpp

The code in the following files:

  • patientAccount.cpp
  • accountDriver.cpp
  • patientAccount.h
  • Please use these file names exactly.

Summary

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

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

Step: 1

patientAccounth file ifndef PATIENTACCOUNTH define PATIENTACCOUNTH class PatientAccount private const static int genId100static member for generating and initializing patientID int patientID double ba... 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

Principles of Finance

Authors: Scott Besley, Eugene F. Brigham

6th edition

9781305178045, 1285429648, 1305178041, 978-1285429649

More Books

Students also viewed these Programming questions

Question

What is a financial market? What is the role of a financial market?

Answered: 1 week ago