The code for this is as follows:

const kelvin = 0;
// This is the constant for kelvin. 
// Since it is fixed, 'const' is used instead of 'let'.

var celsius = kelvin - 273
// This is celsius, which is 273C less than the kelvin value. 
// Since it will always be 273 less, this subtraction algorithm is used.

var fahrenheit = celsius * 9/5 + 32
// This is fahrenheit, a variable that is relative to celsius. 
// It is hence relative to kelvin. 
// It is hence calculated from the variable celsius.

fahrenheit = Math.floor(fahrenheit);
// Fahrenheit is rounded down.

console.log(`The temperature is ${fahrenheit} degrees Fahrenheit.`)

What we can illustrate from this code:

  1. The temperature units of celsius, kelvin and fahrenheit are interchangeable.
  2. The formulae of the units.
  3. How do we change this code to allow for user input.

Disclaimer: This was created as part of the Codecademy course on JS (JavaScript).