8000 Rephrase tempConversion instructions · joshbjorn/javascript-exercises@c17c207 · GitHub
[go: up one dir, main page]

Skip to content

Commit c17c207

Browse files
Rephrase tempConversion instructions
- keep only main instructions above code sample (and move explanation about `module.exports` after the example) - clarify that results should be rounded to one decimal place (as assume by tests)
1 parent 3a9251d commit c17c207

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tempConversion/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
# Exercise 06 - tempConversion
22

3-
This exercise asks you to create more than one function so the module.exports section of the spec file looks a little different this time. Nothing to worry about, we're just packaging the functions into an object to be exported.
4-
5-
Write two functions that convert temperatures from Fahrenheit to Celsius (and the other way around):
3+
Write two functions that convert temperatures from Fahrenheit to Celsius, and vice versa:
64
```
75
ftoc(32) // fahrenheit to celsius, should return 0
86
97
ctof(0) // celsius to fahrenheit, should return 32
108
```
119

10+
Because we are human, we want the result temperature to be rounded to one decimal place: i.e., `ftoc(100)` should return `37.8` and not `37.77777777777778`.
11+
12+
This exercise asks you to create more than one function so the `module.exports` section of the spec file looks a little different this time. Nothing to worry about, we're just packaging both functions into a single object to be exported.
1213

1314
## hints
14-
The math here is fairly straightforward.. just google the formula and implement it in the code
15+
- You can find the relevant formulae on [Wikipedia](https://en.wikipedia.org/wiki/Conversion_of_units_of_temperature).
16+
17+
- Try to find by yourself on the Internet how to round a number to 1 decimal place in JavaScript. If you struggle, have a look [here](https://stackoverflow.com/q/7342957/5433628).

0 commit comments

Comments
 (0)
0