Answer to Question #276519 in Python for jayalal

Question #276519

Convert the above algorithm to a Python program to output the desired results.


1.Start

2.Initialize Sum , Count to 1 ( Sum = 1 , Count = 1 )

3.Enter a temp

4.Add Temp to sum. ( Sum = Temp + Sum )

5.Increase Counter by 1 ( Count = Count + 1)

6.Repeat step 3 through 5 , Ten times

7.Calculat average temp in Fahrenheit (Average temp = (( sum * 9 / 5 ) + 32 ) / 10 )

8.If t Average temp is more than or equal to 97 and Average temp is less than or equal to 99 then Display “Your body temperature is normal”

9.Else  Average temp is more than to 100.4 then Display “You have a fever caused by an infection or illness”

10.End.


1
Expert's answer
2021-12-07T09:21:52-0500
#1.Start
#2.Initialize Sum , Count to 1 ( Sum = 1 , Count = 1 )
Sum = 1
Count = 1
while Count <= 10:
    #3.Enter a temp
    Temp=float(input("Enter a temp: "))
    #4.Add Temp to sum. ( Sum = Temp + Sum )
    Sum = Temp + Sum
    #5.Increase Counter by 1 ( Count = Count + 1)
    Count = Count + 1
    #6.Repeat step 3 through 5 , Ten times


#7.Calculat average temp in Fahrenheit (Average temp = (( sum * 9 / 5 ) + 32 ) / 10 )
AverageTemp = (( Sum * 9 / 5 ) + 32 ) / 10 
#8.If t Average temp is more than or equal to 97 and Average temp is less than or equal to 99 then Display “Your body temperature is normal”
if AverageTemp >= 97 and AverageTemp <= 99:
    print('Your body temperature is normal')
if AverageTemp > 100.4:
    #9.Else  Average temp is more than to 100.4 then Display “You have a fever caused by an infection or illness”
    print('You have a fever caused by an infection or illness')
#10.End.

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS