Question: Problem Statement Swedish astronomer Andres Celsius created the Centigrade scale, which is known more widely as the Celsius scale. Water freezes at 0 degrees on

Problem Statement
Swedish astronomer Andres Celsius created the Centigrade scale, which is known more widely as the Celsius scale. Water freezes at 0 degrees on the Centigrade scale and boils at 100 degrees. The Fahrenheit scale, developed by German physicist Daniel Gabriel Fahrenheit, also exists (and is used in countries such as the United States and its territories). In the Fahrenheit scale, water freezes at 32 degrees and boils at 212 degrees. The Centigrade to Fahrenheit conversion formula is
C =(5/9)*(F -32)
where F is the Fahrenheit temperature.
Write a program that takes in a temperature value (e.g.,45F,102C etc.) and convert it to the other scale. For example, if the input is F, convert to C (and vice versa).
Round your temperature values to the nearest integer when printing them.
If the input does not include "F" or "C" at the end of the temperature, print "Wrong input format."
Sample Input 1:
32F
Sample Output 1:
32F =0C
Sample Input 2:
100C
Sample Output 2:
100C =212F

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!