Question: Write a program that reads a file of charges for a patients hospital stay in a WINDOWS FORM APPLICATION C# . The file's name should
Write a program that reads a file of charges for a patients hospital stay in a WINDOWS FORM APPLICATION C#. The file's name should be labeled as "hospbillingdata.txt"
The file contains two sets of records: Patients that were admitted as an in-patient (I). Patients that were admitted as an outpatient (O).
If the patient was an in-patient (I), the following data should be used:
- The number of days spent in the hospital.
- The daily rate for hospital services.
- Hospital medication charges.
- Formula for charges: (Days * Rate) + Charges
If the patient was an out-patient (O) you wont be doing anything with that record.
The program should display and calculate the following:
- Total charges for each "I" type of patient ("I" only, you wont be doing anything with the "O" - outpatients records), then add that total to an in-patient listbox.
- Grand Total (accumulated total charges) for number of in-patient charges below the listbox.
- A count of in-patient records and display the count below the listbox.
- Grand Total number of records read overall in a label.
- Use OpenFileDialog control. - Hardcode the name of the output file. - Use a While loop that reads the file till EOF - Use Streamreader Object - Use Streamwriter Object - A counter that counts how many records have been written out.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
