mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-05-15 09:48:45 +00:00
Add inverted formula and its derivation to hint
This commit is contained in:
parent
360344ab6c
commit
361a7f501e
@ -1171,8 +1171,13 @@ Use the `as` operator to cast one of the operands in the last line of the
|
|||||||
name = "conversions2"
|
name = "conversions2"
|
||||||
dir = "23_conversions"
|
dir = "23_conversions"
|
||||||
hint = """
|
hint = """
|
||||||
For the conversion from Fahrenheit to Celsius, you have to determine the formula
|
The formula for converting from Fahrenheit to Celsius is: C = (F - 32) / 1.8
|
||||||
yourself. Don't forget the order of operations!"""
|
This can be derived from the first formula:
|
||||||
|
|
||||||
|
F = C * 1.8 + 32 // now subtract 32 on both sides
|
||||||
|
F - 32 = C * 1.8 // then divide by 1.8
|
||||||
|
(F - 32) / 1.8 = C
|
||||||
|
"""
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "conversions3"
|
name = "conversions3"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user