diff --git a/exercises/concept/temperature/.docs/hints.md b/exercises/concept/temperature/.docs/hints.md index d9fdbdef1..aedfb9ee4 100644 --- a/exercises/concept/temperature/.docs/hints.md +++ b/exercises/concept/temperature/.docs/hints.md @@ -1,13 +1,13 @@ # Hints -## Convert Farenheit to Celsius +## 1. Convert Fahrenheit to Celsius -- Temperature in degrees Celsius is defined as: T(°F) = T(°C) × 1.8 + 32 -- The temperature in Farenheit is provided as an `Integer` and must return Celsius as a `Float`. +- Temperature in degrees Celsius is defined as: T(°C) = (T(°F) - 32) / 1.8 +- The temperature in Fahrenheit is provided as an `Integer` and must return Celsius as a `Float`. The `fromInteger` function will come in handy. -## Convert Celsius to Farenheit +## 2. Convert Celsius to Fahrenheit -- Temperature in degrees Fahrenheit is defined as: T(°C) = (T(°F) - 32) / 1.8 -- The temperature in Celcius is provided as a `Float` and must return Farenheit rounded up to the closest `Integer`. +- Temperature in degrees Fahrenheit is defined as: T(°F) = T(°C) × 1.8 + 32 +- The temperature in Celcius is provided as a `Float` and must return Fahrenheit rounded up to the closest `Integer`. The `ceiling` function will come in handy. diff --git a/exercises/concept/temperature/.docs/instructions.md b/exercises/concept/temperature/.docs/instructions.md index dbe9343e9..60bf97baa 100644 --- a/exercises/concept/temperature/.docs/instructions.md +++ b/exercises/concept/temperature/.docs/instructions.md @@ -4,7 +4,7 @@ You are part of a firefighter organization made of international volunteers. Due to the international nature of the team, valuable time has been wasted over the last few calls translating between Fahrenheit and Celcius while estimating the temperature inside the burning buildings. To save time, and people, you decide to create a program to automatically convert between Fahrenheit and Celsius for your international team. -## 1. Convert Farenheit to Celsius +## 1. Convert Fahrenheit to Celsius Implement the `tempToC` function to convert an `Integer` temperature in Fahrenheit to its equivalent `Float` in Celsius rounded to the nearest hundredth. Temperature in degrees Celsius is defined as: T(°C) = (T(°F) - 32) / 1.8. @@ -14,11 +14,11 @@ Temperature in degrees Celsius is defined as: T(°C) = (T(°F) - 32) / 1.8. 0.00 ``` -## 2. Convert Celsius to Farenheit +## 2. Convert Celsius to Fahrenheit Implement the `tempToF` function to convert a `Float` temperature in Celsius to its equivalent in Fahrenheit. For safety reasons, **round up** the result to the **next-highest** `Integer`. -Temperature in degrees Farenheit is defined as: T(°F) = T(°C) × 1.8 + 32. +Temperature in degrees Fahrenheit is defined as: T(°F) = T(°C) × 1.8 + 32. ```Haskell > tempToF 4