A program to check the health of a number of persons has to be written. Each person is
asked to enter his/her body temperature (T) and one of the following messages is
displayed:
‘You are in good health!’ if 37.5>T>36.5;
‘Your health is not Good!’ if 35.5>T>36.5; and
‘Your temperature is very high!’ if T>38.5.
The program has to terminate when -1 is entered for the temperature. Draw a flowchart
for this problem.
solution:
PROGRAM BodyTemperature;
uses Crt;
var name:string;
t:real;
begin
write('enter your name:');
readln(name);
writeln;
writeln('you are welcome,',name);
write('enter body temperature:');
readln(t);
if((37.5>t) and (t>36.5))then
writeln('you are in good health!')
else
if9(t>36.5)and(t>35.5))then
writeln('you health is not good!')
else
if(t > 38.5)then
writeln('Your temperature is very high!');
readln;
end.
asked to enter his/her body temperature (T) and one of the following messages is
displayed:
‘You are in good health!’ if 37.5>T>36.5;
‘Your health is not Good!’ if 35.5>T>36.5; and
‘Your temperature is very high!’ if T>38.5.
The program has to terminate when -1 is entered for the temperature. Draw a flowchart
for this problem.
solution:
PROGRAM BodyTemperature;
uses Crt;
var name:string;
t:real;
begin
write('enter your name:');
readln(name);
writeln;
writeln('you are welcome,',name);
write('enter body temperature:');
readln(t);
if((37.5>t) and (t>36.5))then
writeln('you are in good health!')
else
if9(t>36.5)and(t>35.5))then
writeln('you health is not good!')
else
if(t > 38.5)then
writeln('Your temperature is very high!');
readln;
end.
0 comments:
Post a Comment