Question: Code a CH program utilizing one or more selection structures to solve the following prob- lem: Write a program to compute charges for a patient

Code a CH program utilizing one or more selection structures to solve the following prob- lem: Write a program to compute charges for a patient in Community Hospital. Charges per day per patient are computed from the following: Room charges per day: Private room: $125.00 Semi private room: $ 95.00 Ward: $ 75.00 Telephone charge per day: $ 1.75 Television charge per day: $ 3.50 Name of the individual, patient identification number, type of room. Have the user enter the number of days, the type of room (P, S, W), whether or not patient had a telephone (Y/N), and whether or not the patient had a television (Y/N). Compute the patient's bill and print out an itemized statement similar to the following: COMMUNITY HOSPITAL PATIENT BILLING STATEMENT Name: Mary Jones Patient D: 9523 Number of days in hospital: 5 Type of Room: Private Room Charge: $625.00 Telephone Charge: $0.00 Television Charge: $17.50 TOTAL DUE: $642.50 Be sure to include adequate error checking in your program and error data when you run the program to demonstrate error checking. Input Patient name and Id, number of days, room type, telephone option, television option. Output Itemized bill of each charge and total owed by the patient. Label all output for readabil- ity. Align all decimal points. Be sure your output contains user prompts and what was entered by the user in addition to the results of your program processing. Adequately check entered data for validity. Use adequate test data to process all valid data and representative examples of invalid data to show how your program handles invalid data. Remember: if any part of the input is invalid, do NOT calculate costs and output error information. Itemized hospital costs should only be shown for valid inputs. Be sure your program output has decimal digits aligned
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
