A group of medical students were monitoring the body temperature of a patient daily basis. Students captured 10 temperature readings in Celsius on a particular day.
1. Write an Algorithm to input these ten values and get the average temperature for that day. if the average temperature value is in between 970 Fahrenheit and 990 Fahrenheit then display the message “Your body temperature is normal…”. If it is more than 100.40 Fahrenheit then display the message “You have a fever caused by an infection or illness…”.
input::
array tc(10) \\ 10 temperature readings in Celsius
t=0
for i from 1 to 10
t=t+t[i] \\ calculate average temperature
tf=1.8*t+32 \\ convert Celsius to Fahrenheit
if 970 <= tf <= 990 then
display “Your body temperature is normal”
else if tf > 100.4 then
display “You have a fever caused by an infection or illness”
Comments
Leave a comment