Patient Temperature Program
Keep track of patient's temperatures.
- A hospital has 10
patients.
- A patient has an ID number from 1 to 10.
- Use an array to keep
track of the temperatures.
- The temperature values can have decimal
values, such as 98.6.
- All temps are in fahrenheit. Please label them as F when entering
or displaying the temperatures.
Have a menu using a SWITCH statement to do the following:
Show Temperatures
Enter Temperature
Delete Temperature
Quit
Use
a separate function for each menu item. Also have a separate function
called initialize, which will set all the temperatures to 0. 0 means
that the patent does not have a temperature value.
After each menu choice is finish, return to the main menu.
Show Temperatures: Display all patients who's ID contain a temperature
value that is not 0.
Enter
Temperature: Let you enter in a patent's temperature. It will ask the
user for the patent ID. Make sure the patient ID is within the range of
1 to 10!
Then ask the user for the temperature value. Valid temperature ranges
are from 90 to 110 F. If the user enters in a value that is not valid,
give them a text warning and tone (Bell Sound), and ask them to enter
in again. Keep repeating until the user enters a correct value.
Delete Temperature: asks for a patient's ID to remove the
temperature. Make
sure the patient's ID within the range of 1 to 10. Have a
confirmation that asks if you really want to delete the temperature. If
the user presses Y or y allow the temperature to be deleted. If the
user enters in N or n, do not delete the temperature. For any other
key, repeat the choice again. To delete a temperature, have the program
set the temperature to 0.
Quit: gives an exit message and then exits.
Display the menu as the shown
(S)how Temperatures
(E)nter Temperature
(D)elete Temperature
(Q)uit
The
letter in ( ) is the letter the person selects to make a selection. If
the person enters in an invalid menu choice, redisplay the menu.
Capture all the output and hand
it in.
Please test your program by doing the following:
S
E
1
98.6
E
0
2
100
E
2
9
99
D
11
0
2
y
E
11
10
120
97.9
E
5
100.5
S
Q