# Basic Algorithm Scripting - Convert Celsius to Fahrenheit

Tell us what’s happening:
Describe your issue in detail here.

I can’t get this challenge to pass. I’ve read several forums and the solution I wrote is what some others have passed it with. Am I missing something simple here?

``````  **Your code so far**
``````
``````function convertToF(celsius) {
let fahrenheit = celsius * 9/5 + 32;
return fahrenheit;
}

convertToF(30);
``````
``````  **Your browser information:**
``````

User Agent is: `Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36`

Challenge: Basic Algorithm Scripting - Convert Celsius to Fahrenheit

All of them. I wrote console.log(convertToF(); and passed every number through it. The correct Fahrenheit conversion is displayed in the console. Yet, this code is not passing.

instead of copying the solutions, look carefully at the tests. Are you using the correct function?

I didn’t copy a solution, I wrote the one in the problem. I discovered in the Forum that others had passed this challenge with the same code I had written.

I’m not understanding what you mean by the “Are you using the correct function?”'. Are you asking if I’m calling the correct function?

if you are writing the correct function, look carefully at the tests

Ah, I see what you mean now. Thank you.

What is the learning objecive of this challenge? Free Code Camp wrote in the the name of the function and called it.

if you reset the code of the challenge, the starting code is

``````function convertCtoF(celsius) {
let fahrenheit;
return fahrenheit;
}

convertCtoF(30);
``````

It’s a small algorithm, every algorithm you solve means more practice with the language, they will get increasingly more comprex as you progress

I’m all for increasing the complexity, but that wasn’t the issue with this challenge. When you say “It’s a small algorithm”, do you mean the function name was deliberately made wrong for me to figure out?

No. The function was deliberately incomplete. You need to finish the `convertCtoF()` function.
`convertToF()` is an old name for the function in this challenge and it is only in old solutions posted on the forum - is not part of the starting code provided to users.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.