Question
Help in C language Please Hospital Billing Program Write a program that calculates a hospital bill for a surgical procedure. You will write a total
Help in C language Please
Hospital Billing Program
Write a program that calculates a hospital bill for a surgical procedure. You will write a total of four (AND ONLY FOUR not including main) functions: askHospitalDays(), askSurgeryLevel(), askMedication(), calcAndPrintHospitalBill(). Details for the functions are below.
The main() function will call ALL of the functions and will contain the prices for the surgical procedures and the lab fees in two separate arrays as follows:
Surgical prices Lab Fees
Level 1: $ 1,500.00 $ 500.00 Level 2: $ 3,250.00 $1,025.00 Level 3: $ 6,579.99 $2,500.99 Level 4: $12,999.99 $5,290.00 Level 5: $25,450.00 $9,875.99
Your main() function will first ask the user for the patients medical id, the patients last initial, and the patients first initial. You do NOT have to validate any of this information.
The askHospitalDays() function will accept the patients information (medical id, first, and last initial). The function will ask the user the number of days the patient stayed in the hospital. You must use a loop to validate this data. A person can only stay in the hospital for no more than 21 days and at least one day. Your function will return the number of days.
The askSurgeryLevel() function will accept the patients information (medical id, first, and last initial). The function will ask the user the level of surgery they had ( 1 5 ). You must use a loop to validate this data. Your function will return the surgery level.
The askMedication() function will accept the patients information (medical id, first, and last initial) and an empty array to hold the medication prices. The function will then ask how many medications were used for that patient. You must use a loop to validate this data. The number of medications must at least be one, but no more than 10. Once you know how many medications were used, use a loop to ask for the price of each medication (stored in your array). Your function will return the number of medications that were used.
The calcAndPrintHospitalBill () will accept all data necessary to display the following information. You will need to send the medication prices array to this function to calculate the charges. The daily charge is $350.00.
Billing Statement for Level 2 Surgical Procedure.
Patient: A.D. #15978
Daily Charge: $ 1400.00 Medication Charges: $ 600.00 Surgical Charges: $ 3250.00 Lab Charges: $ 1025.00
Total Due: $ 6275.00
Sample Run:
Please enter the patients medical ID: 15978
Please enter the patients last Initial: D
Please enter the patients first Initial: A
How many days did patient A.D. #15978 stay in the hospital? 4
What level of surgery did patient A.D. #15978 have (1-5) 2
How many medications were used for patient A.D. #15978? (up to 10) 6
Enter price for medication #1 --> 250.00
Enter price for medication #2 --> 100.00
Enter price for medication #3 --> 87.50
Enter price for medication #4 --> 22.50
Enter price for medication #5 --> 50.00
Enter price for medication #6 --> 90.00
Billing Statement for Level 2 Surgical Procedure.
Patient: A.D. #15978
Daily Charge: $ 1400.00 Medication Charges: $ 600.00 Surgical Charges: $ 3250.00 Lab Charges: $ 1025.00
Total Due: $ 6275.00
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