Question

Write a program that converts a
temperature from degrees Fahrenheit to degrees
Celsius and vice versa. The program first prompts the user for the
type of conversion
by asking to enter one single character. If the user supplies the
letters C or c, this
means s/he needs the temperature to be converted from Celsius to
Fahrenheit. If the
user supplies the letters F or f, this means s/he needs the
temperature to be converted from Fahrenheit to Celsius. If the user
supplies any other letters, the program should report that it is
not a valid conversion then exit. The converted temperature result
willbe displayed on the screen along with appropriate messages. The
formula for converting from Fahrenheit (F) to Celsius (C) is given
below. This formula can be easily rearranged to compute the other
conversion. Output should be displayed neatly using three decimal
places. Sample outputs are given in the snapshots below.