Question: help in c++ pls Write a program that computes and displays the charges for a patient's hospital visit. The program should accomplish the following: -

help in c++ plshelp in c++ pls Write a program that computes and displays the

Write a program that computes and displays the charges for a patient's hospital visit. The program should accomplish the following: - Read in a character representing whether the patient is inpatient or outpatient. An 'I' should be interpreted as inpatient and an ' O ' should be interpreted as outpatient. - If the patient is inpatient, read in and validate the following data: - The number of days spent in the hospital - The daily rate - Hospital medication charges - Charges for hospital services (lab tests, etc.) - If the patient is outpatient, read in and validate the following data: - Hospital medication charges - Charges for hospital services (lab tests, etc.) - Use two overloaded functions to calculate the total charges: - The first function should accept arguments for the inpatient data and should have a function header as follows: double patientCharges (int days, double rate, double med, double serv) It will calculate the total charges as days times daily rate plus medical charges plus service charges and return that value. - The second function will accept arguments for outpatient information with a function header as follows: double patientCharges (double med, double serv) It will calculate the total charges as medical charges plus service charges and return that value. - Use a function to output the dashes. Accept the number of dashes to be output as an argument. An appropriate function header is as follows: void printDashes (int num) There are 26 dashes in the output table. - Output all dollar amounts right justified in a field width of 10. - Input Validation: Do not accept anything but 'I' or 'O' for patient type. Do not accept negative numbers for any data. When the input is as shown in Figure 1, your program should produce the output as shown in Figure 2. Figure 1: (sample input) 1iI11289.75289.7538.53138.5310251025 Figure 2: (sample output) $$289.75-1daysat$289.75perday38.53-medicationcharges

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!