Bilbo?s Hospital needs a program to print out patient bills. There are 2 categories of patients, in-patient
Question:
Bilbo?s Hospital needs a program to print out patient bills. There are 2 categories of patients, in-patient and out-patient. The category will be indicated with and 'I' or 'O'. In addition to the main program, you are to write 2 functions, one called InParI'eai/l and the other called OutPatienBill.
The main program begins by reading the patient ID number. Then read a single character
indicating in-patient or outpatient.
The ID number of in-patients begins with 1 through 5. Outpatients begin with 6 through 9. Use an if/else to validate the ID number with the patient type. Print the patient ID number
and an error message if they do not match correctly. Read the remaining information for the
patient type, but disregard it. The main program does all reading of data and all output.
If the patient type is an 'I? then 4 values are read: if an ?0' then 2 values are read. Check for both upper and lower case. Then the functions are called to make the calculations. Use a switch statement or if/else statement to distinguish between the '0' and ?I?.
For InPatientBill, the following information is required as parameters:
Number of Days spent in hospital
Daily Rate Charge
Charges for other hospital services (lobs tests, etc.)
Medications
For OutPatientBill, the following information is required as parameters:
Charges for hospital services (lab tests, etc.)
Medications
The functions are to calculate the total bill using the input parameters and return the final charge. The functions have NO NO statements.
InPotientBill calculates the charges by multiplying the number of days by the daily rate charge then adding in the other two parameter values. OutPatientBill calculates the charges by adding the 2 parameters plus a $10 processing fee to each bill.
The main program is to read data until the end of the file. A second data file will be provided next week. Run the program for the data below 6: for the next file and turn in both. ~ Get your program running with cin/cout then convert to file I/O. Create your own data file from the data below.