Question: programming language: C++ visual studios Programming Challenge 16- Overloaded Hospital without Overloaded Functions Write a program that computers and displays the charges for a patients

programming language: C++ visual studios

Programming Challenge 16- Overloaded Hospital without Overloaded Functions

Write a program that computers and displays the charges for a patients hospital stay. First the program should ask if the patient was admitted as an in-patient or out-patient.

If the patient was an in-patient the following data should be entered:

-the number of days spent in the hospital

-the daily rate

-charges for the hospital services (lab tests, etc.)

-hospital medication charges

If the patient was an out-patient the following data should be entered:

-charges for hospital services (lab tests, etc.)

-hospital medication charges

Use a single separate function to validate that no input is less than zero. If it is it should be reentered before being returned. Once the data has been input, the program should use two functions to calculate the total charges. One of the of the functions should accept arguments for the in-patient data while the other function accepts arguments for the out-patient data. Both functions should return the total charges. When you solve this problem, use different names for the two functions. No need to overload functions.

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!