Welcome to DailyProgrammer University. Today you will be earning a degree in converting degrees. This includes Fahrenheit, Celsius, Kelvin, Degrees (angle), and Radians.
You will be given two lines of text as input. On the first line, you will receive a number followed by two letters, the first representing the unit that the number is currently in, the second representing the unit it needs to be converted to.
Examples of valid units are:
d
for degrees of a circler
for radians
You must output the given input value, in the unit specified. It must be followed by the unit letter. You may round to a whole number, or to a few decimal places.
3.1416rd
90dr
180d
1.56r
Also support these units:
c
for Celsiusf
for Fahrenheitk
for Kelvin
If the two units given are incompatible, give an error message as output.
212fc
70cf
100cr
315.15kc
100c
158f
No candidate for conversion
42c
- See here for a wikipedia page with temperature conversion formulas.
- See here for a random web link about converting between degrees and radians.
Have a good challenge idea? Consider submitting it to /r/dailyprogrammer_ideas