Community Hospital needs a program to compute and print a billing statement for each patient.
Charges for each day are as follows:
a. room charges: private (P) room = $125.00; semi-private (S) room = $95.00; or ward (W) = $75.00
b. telephone charge = $1.75
c. television charge = $3.50
Write a program to get data from the keyboard, compute the patient’s bill, and print an appropriate statement. Typical input (nut yours do not have to be identical to this) is the following:
How many days was the room occupied? 5
What type of room? P
Telephone used during the stay? N
Television used during the stay? Y
Keep in mind that the user needs to know that the input can be any integer number of days for the length of stay, either (P, S, or W) for the room type, and either (Y or N) for both telephone and television options.
A statement (which yours MUST be identical to) for the data given follows:
Community Hospital Patient Billing Statement
Number of days in hospital: 5
Type of room: Private
Room charge: $ 625.00
Telephone charge: $ 0.00
Television charge: $ 17.50
Some of your code looks like it's cut off. This won't work at all.
Get the input for each variable.
The user might enter upper or lowercase variables, so use tolower() or toupper() on your characters. These functions return a lowercase or uppercase version of your character (if applicable). They do not change that variable.
Use a switch case for your characters (looks like you have that).