{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


assign2xxx4.b - if the patient chooses semi-private then...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
The ABC Community Hospital needs a program to compute and print the billing statement for each of its  patient. The following table shows the fees for the various services: Write a class called Hospital that accepts the following indicators: A five digit string value representing the patient identification number The patient’s name (First name and last name) An integer representing the number of days the patient is in the hospital. A single character representing the type of room the patient chooses. Room type (P/p= private, S/s means  semi-private, and W/w means ward) As part of the billing, note the following: If a patient chooses private room, the cost for medication is twice what is shown on the billing chart; 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: if the patient chooses semi-private, then the cost for medication is what is shown on the billing chart; and if the patient chooses ward, then the medication cost is half what is shown on the billing chart. • A patient who chooses private room pays for television service and telephone service; a patient who chooses semi-private room pays for television service, and a patient who chooses the ward gets television and telephone services free. These are flat fees (one time fees). A typical output is as follows (Note: you are required to use the switch statement to determine the room type)...
View Full Document

{[ snackBarMessage ]}