Computer Science, asked by aaravkanodia2008, 3 hours ago

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 Equestriadash
4

The following co‎des have been written using Python.

\tt t\ =\ float(in put("Enter\ your\ temperature\ [in\ Celsius]:\ "))\\f\ =\ t*(9/5)\ +\ 32\\if\ f\ >\ 102:\\{\ \ \ \ \ }print("You\ need\ to\ visit\ the\ doctor.")\\elif\ f\ >\ 99\ and\ f\ <\ 101.9:\\{\ \ \ \ \ }print("Take\ rest.")\\elif\ f\ <\ 99:\\{\ \ \ \ \ }print("You\ are\ fine!")

Once the temperature (t) has been entered, the conversion into Fahrenheit is done and the checking is done using conditional statements. Appropriate print statements as per the question are pas‎sed according to each individual condition. Conditional statements are useful in checking for certain requirements for the program to proceed accordingly.

Similar questions