Convert the Temperature

You are given a non-negative floating point number `celsius` rounded to two decimal places, the temperature in Celsius. Convert it to Kelvin and Fahrenheit and return them as an array `[kelvin, fahrenheit]`. Kelvin = Celsius + 273.15 Fahrenheit = Celsius * 1.80 + 32.00 Answers within $10^{-5}$ of the actual answer are accepted.

30:00

Convert the Temperature
easy
Free written solution
Topics
Companies

You are given a non-negative floating point number celsius rounded to two decimal places, the temperature in Celsius. Convert it to Kelvin and Fahrenheit and return them as an array [kelvin, fahrenheit].

Kelvin = Celsius + 273.15

Fahrenheit = Celsius * 1.80 + 32.00

Answers within 10−510^{-5} of the actual answer are accepted.

Example 1:
Input: {"celsius":36.5}
Output: [309.65,97.7]
Constraints:
  • 0≤celsius≤10000 \leq \text{celsius} \leq 1000

Test Cases
Input (Stdin)
Expected Output (Stdout)
Execution Result

Run code to see results.

Input
arr ={"celsius":36.5}

The thermometer reads 36.5 degrees Celsius. The same physical level has a different number on the Kelvin and Fahrenheit scales.

Kelvin273.15373.15Celsius010036.5Fahrenheit32212+273.15x1.8 +32

kelvin

36.5 + 273.15 = ?

stretch

36.5 * 1.8 = ?

fahrenheit

? + 32 = ?

Variables
VariableValue
celsius36.5
DepthFunction Call
Stack empty
0/4