Enduring Hospital Case Study

297 Words2 Pages

// Steven Meade
// Page 403 Assignment 14, Overloaded Hospital
// This program computes and displays the charges for a patients hospital stay

#include using namespace std; double patient(int days, double rate, double medicalCharges, double HospitalServicesCharges); double patient(double medicalCharges, double HospitalServicesCharges); int main()
{
char ans; cout << "Were you an in-patient (Enter I) or were you an out-patient (Enter O)? "; cin >> ans; cout << endl; if (ans == 'I ' || ans == 'i ') { int days; double rate, medicalCharges, HospitalServicesCharges; double total; cout << "Enter the number of days spent in the hospital: "; cin >> days;

cout << "Enter the daily rate: "; cin >> rate;

cout << "Enter the charges for the hospital services: "; …show more content…

"; cin >> HospitalServicesCharges;

cout << "Enter the hospital medication charges: "; cin >> medicalCharges;

total = patient(days, rate, medicalCharges, HospitalServicesCharges); cout << "Patient total charges $" << total;

} else if (ans == 'O ' || ans == 'o ') { double medicalCharges, HospitalServicesCharges; double total; cout << "Enter the charges for the hospital services: "; cin >> HospitalServicesCharges;

cout << "Enter the hospital medication charges: "; cin >> medicalCharges;

total = patient(medicalCharges, HospitalServicesCharges); cout << "Patient total charges $" << total