Oliver Eyton-Williams ee1e8abd87
feat(curriculum): restore seed + solution to Chinese (#40683)
* feat(tools): add seed/solution restore script

* chore(curriculum): remove empty sections' markers

* chore(curriculum): add seed + solution to Chinese

* chore: remove old formatter

* fix: update getChallenges

parse translated challenges separately, without reference to the source

* chore(curriculum): add dashedName to English

* chore(curriculum): add dashedName to Chinese

* refactor: remove unused challenge property 'name'

* fix: relax dashedName requirement

* fix: stray tag

Remove stray `pre` tag from challenge file.

Signed-off-by: nhcarrigan <nhcarrigan@gmail.com>

Co-authored-by: nhcarrigan <nhcarrigan@gmail.com>
2021-01-12 19:31:00 -07:00

1.4 KiB

id, title, challengeType, forumTopicId, dashedName
id title challengeType forumTopicId dashedName
56533eb9ac21ba0edf2244b3 Convert Celsius to Fahrenheit 1 16806 convert-celsius-to-fahrenheit

--description--

The algorithm to convert from Celsius to Fahrenheit is the temperature in Celsius times 9/5, plus 32.

You are given a variable celsius representing a temperature in Celsius. Use the variable fahrenheit already defined and assign it the Fahrenheit temperature equivalent to the given Celsius temperature. Use the algorithm mentioned above to help convert the Celsius temperature to Fahrenheit.

--hints--

convertToF(0) should return a number

assert(typeof convertToF(0) === 'number');

convertToF(-30) should return a value of -22

assert(convertToF(-30) === -22);

convertToF(-10) should return a value of 14

assert(convertToF(-10) === 14);

convertToF(0) should return a value of 32

assert(convertToF(0) === 32);

convertToF(20) should return a value of 68

assert(convertToF(20) === 68);

convertToF(30) should return a value of 86

assert(convertToF(30) === 86);

--seed--

--seed-contents--

function convertToF(celsius) {
  let fahrenheit;
  return fahrenheit;
}

convertToF(30);

--solutions--

function convertToF(celsius) {
  let fahrenheit = celsius * 9/5 + 32;

  return fahrenheit;
}

convertToF(30);