LAB3 ASSIGNMENTThis assignment is kind of sophomore level. So do not use any complex and high-level function in the program.Ø The assigned problem is Group Project, page 505, Patient Fees from your...

1 answer below »
LAB3 ASSIGNMENTThis assignment is kind of sophomore level. So do not use any complex and high-level function in the program.Ø The assigned problem is Group Project, page 505, Patient Fees from your textbook.Ø Only the .cpp and .h should be submitted. Youmay include a text file to explain who did what and any assumptions that you may have used.Ø Your code should:o include comments to explain main functionalities,o be tested using different inputs, o have the correct indentation,o use the correct identifiers names according to the used naming convention (as in your textbook).Ø Check rubric before submitting your code.Moreover, please copy from the Internet.
Answered Same DayFeb 26, 2020

Answer To: LAB3 ASSIGNMENTThis assignment is kind of sophomore level. So do not use any complex and high-level...

Saurabh answered on Feb 27 2020
102 Votes
Solution/main.cpp#include #include #include #include "PatientAccount.h"
#include "Surgery.h"
#include "Pharmacy.h"
using namespace std;
void typeOfSurgery();
Function prototype that show all the type of surgery
void selectMedication(PatientAccount &newPatientAccount, Pharmacy &newMedication);
Function prototype for the pharmacy
void checkOut(PatientAccount newPatientAccount, Surgery NewSurgery, Pharmacy newMedication);
Function prototype to check the patient out of the hospital
void checkoutBanner();
int main()
{
typeOfSurgery();
return 0;
}
void typeOfSurgery(){
PatientAccount newPatientAccount;
Create the patient object calls newPatientAccount
cout
endl
endl;
Skip two lines
Surgery NewSurgery;

Create the patient surgery object calls NewSurgery
cout
endl
endl;
Skip two lines
int choice = 0;
Variable to get input from use
int surgeryNumber = 0;
Variable to set the surgery's numbe
do{

This is a menu to allow the user to select the type of surgery
cout
"\t Select a type of surgery"
endl;
cout
"\t 1. Knee replacement surgery."
endl;
cout
"\t 2. Cardiac surgery."
endl;
cout
"\t 3. Trauma surgery."
endl;
cout
"\t 4. Cataract surgery ."
endl;
cout
"\t 5. Biopsy"
endl;
cout
"\n\t Please make a selection: ";
Take input from the use
cin
choice;
Take input from the use
if( (choice <= 0) || (choice > 5) ){
Check if input is valid
cout
"\t Wrong entry ..Please try again!!!"
endl;
Show message
system("Pause");
Stop to let the user know the input is wrong
if (system("CLS")) {system("clean");};
Clear the screen before asking for new input
}else{
If input is valid

eak;
Get out of the loop
}
}while(true);
Loop while the test condition is true
switch(choice){
Examine the user's input to determine what surgery the user chose from the surgery's menu
case 1:
If it is 1
surgeryNumber = 10;
Surgery number is 10

eak;
Stop
case 2:
If it is 2
surgeryNumber = 20;
Surgery number is 20

eak;
Stop
case 3:
If it is 3
surgeryNumber = 30;
Surgery number is 30

eak;
Stop
case 4:
If it is 4
surgeryNumber = 40;
Surgery number is 20

eak;
Stop
case 5:
If it is 5
surgeryNumber = 50;
Surgery number is 20

eak;
}

Set the surgery number for the surgery class. Like a database each surgery has a numbe
NewSurgery.setSurgeryNumber(surgeryNumber);

Set the surgery price base on the surgery numbe
NewSurgery.setSurgeryPrice(NewSurgery.surgeryCharge(surgeryNumber));

Update the patient account with the price of the surgery
newPatientAccount.updatePatientCharge(NewSurgery.surgeryCharge(surgeryNumber));

Create the pharmacy object calls newMedication
Pharmacy newMedication;
/**
This will show the pharmacy menu to allow the user to select a medication
Then pass the pharmacy object to this function in orde
To set the price for the medication
Pass the patient account object to this function to update the
patient's account with the price of the medication.
**
selectMedication(newPatientAccount, newMedication);

Then Pause and wait for the user to press any key before continue to check out
system("Pause");
/**
Call the check out function
pass the newPatientAccount object create from the patient account class to get the patient's information
pass the NewSurgery object created from the surgery class to get the surgery's information
pass the newMedication object create from the pharmacy class.
Then display to the screen the patient's final charge for staying at the hospital
**
checkOut(newPatientAccount, NewSurgery, newMedication);
}
void selectMedication(PatientAccount &newPatientAccount, Pharmacy &newMedication){
int choice = 0;
Variable to get input from use
int medicationNumber = 0;
Variable to set the medication's numbe
do{

Show the user the menu for the medication
cout
"\t Select a name of medication"
endl;
cout
"\t 1. Hydromorphone (Dilaudid) ."
endl;
cout
"\t 2. Hydrocodone."
endl;
cout
"\t 3. Oxycodone 10mg."
endl;
cout
"\t 4. Meperidine (Demerol)."
endl;
cout
"\t 5. Aspirin oral tablet 325 mg ."
endl;
cout
"\t 6. Tranexamic acid 100 mg."
endl;
cout
"\t 7. Norepinephrine ."
endl;
cout
"\t 8. Tranexamic acid 100 mg ."
endl;
cout
"\t 9. Moxeza."
endl;
cout
"\t 10.Xalatan."
endl;
cout
"\n\t Please make a selection: ";
cin
choice;
Get input from the use
if( (choice <= 0) || (choice > 10) ){
If user enter the wrong input
cout
"\t Wrong entry ..Please try again!!!"
endl;
Show message
system("Pause");
Stop to let the user know the input is wrong
if (system("CLS")) {system("clean");};
Clear the screen before asking for new input
}else{
If input is valid

eak;
Get out of the loop
}
}while(true);
Loop while the test condition is true

Like a database each medication has a number,

Once a number is selected, that number is

passed to the medication class to generate

The price for that medication.
switch(choice){
Examine the user's input to determine what surgery the user chose from the surgery's menu
case 1:
If it is 1
medicationNumber = 10;
The medication number is 10

eak;
Stop
case 2:
If it is 2
medicationNumber = 20;
The medication number is 20

eak;
Stop
case 3:
If it is 3
medicationNumber = 30;
The medication number is 30

eak;
Stop
case 4:
If it is 4
medicationNumber = 40;
The medication number is 40

eak;
Stop
case 5:
If it is 5
medicationNumber = 50;
The medication number is 50

eak;
Stop
case 6:
If it is 6
medicationNumber = 60;
The medication number is 60

eak;
Stop
case 7:
If it is 7
medicationNumber = 70;
The medication number is 70

eak;
Stop
case 8:
If it is 8
medicationNumber = 80;
The medication number is 80

eak;
Stop
case 9:
If it is 9
medicationNumber = 90;
The medication number is 90

eak;
Stop
case 10:
If it is 10
medicationNumber = 100;
The medication number is 100

eak;
Stop
}

Set the medication numbe
newMedication.setMedicationNumber(medicationNumber);

Using the medication's number to set the medication's price
newMedication.setMedicationPrice(newMedication.medicationCharge(medicationNumber));

Updated...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here