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:

  1. The number of days spent in the hospital.
  2. The daily rate for hospital services.
  3. Hospital medication charges.
  4. 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:

  1. 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.
  2. Grand Total (accumulated total charges) for number of in-patient charges below the listbox.
  3. A count of in-patient records and display the count below the listbox.
  4. 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!