Answer to Question #274075 in C++ for Zooz

Question #274075

You are asked to write a C++ program to assist a Surgeon with the running of his surgery. Your




program must use functions. This means you must write a function for each of the following tasks:




1) Collect data on each day.




2) Generate a report of how many patients she has seen in the month.




3) Determine the five (5) days in which she made most the money, (five highest earning days).




If there are more than one (1) days in which she made the same amount, just indicate that it




was duplicated on a particular day. Only note or record the last duplicate.




4) Also determine the day on which she saw the least number of patients.




5) Generate a report of how much money she has collected in the month.

1
Expert's answer
2021-12-02T06:47:38-0500
#include <iostream>
	#include <string>
	#include <cctype>
	#include "PatientAccount.h"
	using namespace std;
	
	int main()
	{
	int choice, days;
	double medical, surgery;
	char choice2;
	string line;
	line.assign(50, '-');
	
	PatientAccount bill;
	
	do
	{
	cout << "Hospital Menu" << endl;
	cout << line << endl;
	cout << "Select the type of surgery" << endl;
	cout << "1. Arm Surgery" << endl;
	cout << "2. Hip Surgery" << endl;
	cout << "3. Leg Surgery" << endl;
	cout << "4. Knee Surgery" << endl;
	cout << "5. Neck Surgery" << endl;
	cin >> choice;
	
	bill.setSurgeryCharges(choice);
	
	
	do
	{
	cout << "Which Medications did the patient take? (enter -1 to exit)" << endl;
	cout << "1. TRT" << endl;
	cout << "2. Pain Killers" << endl;
	cout << "3. Stem Cells" << endl;
	cout << "4. Vitamins " << endl;
	cout << "5. Amino Acids" << endl;
	cin >> choice;
	
	bill.setPharmacyCharges(choice);
	
	} while (choice != -1);
	
	
	cout << "For how many days will the patient be at the hospital? ";
	cin >> days;
	bill.setDays(days);
	
	
	
	cout << endl << "Report" << endl;
	cout << line << endl;
	cout << "Total days at the hospital: " << bill.getDays() << endl;
	cout << "Hospital daily rate: $" << bill.getRate() << endl;
	cout << "Total Charges: $" << bill.getCharges() << endl;
	cout << "Total Cost after check out: $" << bill.getCost() << endl;
	
	bill.setCharges(0);
	
	cout << "Do you want to try with another patient? (Y/N) ";
	cin >> choice2;
	cout << endl << endl;
	} while (toupper(choice2) == 'Y');
	
	
	
	return 0;
	}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment