Question
Hospital Charges ASSIGNMENT: Write a program to calculate and display the amount of the charges for a hospital stay. Create a global constant for the
Hospital Charges
ASSIGNMENT:
Write a program to calculate and display the amount of the charges for a hospital stay. Create a global constant for the daily fee of a hospital room ($350.00/day). Ask the user for:
The number of days spent in the hospital
The amount of the medication charges
The amount of the surgical charges
The amount of the lab fees
The amount of the physical rehabilitation charges
Then, using functions, calculate the stay charges (number of days * daily fee for the room), the miscellaneous charges (the total of the medication, surgical, lab, and physical rehabilitation charges), and the total charges. Finally, using a 4th function, display the charges.
There is no validation in this program.
Example Run #1: (bold type is what is entered by the user)
Enter the number of days spent in the hospital: 3
Enter the amount of the medication charges: $125.00
Enter the amount of the surgical charges: $500.00
Enter the amount of the lab fees: $400.00
Enter the amount of the physical rehabilitation charges: $0.00
The cost of the hospital stay is $xxxx.xx
The cost of the miscellaneous charges is $xxxx.xx.
The total cost of the hospital stay is $xxxx.xx.
The example run shows EXACTLY how your program input and output will look.
Write in C, with printf and scanf statements. And using constants and functions where needed.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started