Computer Science, asked by aaravkanodia2008, 5 hours ago

IN PYTHON
Write a program to input temperature of a person in Degrees. Convert it to Fahrenheit using the formula:

℉=℃ × 9/5 + 32

After converting, check if the Fahrenheit temperature is more than 102, then print “go to doctor”. If temperature is between 99 and 101.9, print “take rest”.

If less than 99, print “you are fine”.

Answers

Answered by anindyaadhikari13
3

Solution:

The given problem is solved in Python.

celcius = float(input('Enter temperature in celcius: '))

fahrenheit = round(1.8 * celcius + 32, 2)

print('Your temperature in fahrenheit:', fahrenheit)

if fahrenheit > 102:

   print('Go to doctor.')

else:

   print('You are fine.')

Explanation:

  • Line 1: Accepts the temperature in celcius.
  • Line 2: Calculates the temperature in fahrenheit and rounds the result upto two decimal places.
  • Line 3: Displays the temperature in fahrenheit.
  • Line 4-5: Checks whether the temperature is greater than 102. If true, the program displays 'Go to doctor.'
  • Line 6-7: If the condition becomes false, it displays 'You are fine.'

Refer to the attachment for output.

Attachments:
Similar questions