After learning how to declare variables and use some arithmetic operators, the student is asked to create a function that converts celsius to fahrenheit. It's too soon for this challenge, it involves if, else, logical operators, return, and functions -- which all have not been learned at this point. I think the challenge should be assigned later on when more of these terms are learned. Right now if a student tries to complete this challenge, he can't -- it's too complicated.
The only code that the student has to write is:
The other stuff is written beforehand and is just exposure for the student. Personally, I think it's good for the student to see it.
However, perhaps it should be explained to the student that they should not feel intimidated?
Do you still have this problem? because I can take care of it.
@jacob-on-github - good idea! I think many newcommers would really appreciate that little bit of explanation, or even some modification of a challenge.
Sorry for any flaws in my grammar :)
My proposal:
Add to description:
Don't worry - _functions_ and _return_ statement will be covered in next challenges. In this case, use only operators that You have already learned.
Change the challenge:
function convert(celsius) {
// Only change code below this line
// Only change code above this line
return fahrenheit;
}
// Change the inputs below to test your code
convert(30);
This proposal cuts off a lot of code, but won't scare off people who are real beginners. When filled with proper solution fahrenheit = celsius * (9/5) + 32
it will give necessary output, acceptable by checking algorithms (I've checked it).
I understand that the code in the function is there for completeness but for now, I don't think the below code is necessary.
if ( typeof fahrenheit !== 'undefined' ) {
return fahrenheit;
} else {
return 'fahrenheit not defined';
}
@FreeCodeCamp/issue-moderators thoughts on @dmitrij-schmidt's suggestion above? I personally like it.
@erictleung :+1: to removing that extra code and @dmitrij-schmidt proposal, its neat IMO.
Agreed. This challenge is a few steps ahead of where the lesson is.
This is absolutely way too advanced for the stage I'm at. I'm feeling really stupid right now, if everyone else is managing it and I can't. A challenge is good, but it needs to be worked up to, this comes out of the blue and the instructions given really don't explain what's required or what steps to get to the conclusion. I almost gave up altogether.
And I still have no idea what this part means or what I am supposed to do with it...
// Change the inputs below to test your code
convertToF(30);
@aj-allen-1962 thanks for your feedback. Can you elaborate on your comment on why this challenge "comes out of the blue"? I do agree that the instructions are a little over the place a could be modified for the better.
@erictleung thanks for replying.
Well, each little lesson prior to that was learning a bit about the different operators. But this converter didnt really build on that in any way that makes sense. At least for me, with no real experience with javascript.
function convertToF(celsius) {
var fahrenheit;
// Only change code below this line
// Only change code above this line
return fahrenheit;
}
// Change the inputs below to test your code
convertToF(30);
OK, so the first part, I sort of almost get that, although with the answer somebody gave here, using the star would never have occured for me, I dont recall that being covered previously? Or if it was, it must have only been s short non memorable lesson.
And then down the bottom, I have no idea what this means,
// Change the inputs below to test your code
It's just too much too quick, after a few short little examples leading up to it that haven't really reinforced any of the concepts. I do realize that we need to do some research outside of FFC but this lesson isn't really putting all the previous lessons together into something that is understandable to me.
Maybe if I could find a similar example, or even the answer to this one with some comments about WHY each line was written, it would help me understand it a bit more.
Updated code markdown by @abhisekp - 27th Nov. 2016 - 10:10 PM IST
@aj-allen-1962 we've added the text
Don't worry too much about the function and return statements as they will be covered in future challenges. For now, only use operators that you have already learned.
to put individuals at ease that you don't have to understand all that is going on here.
The star and other necessary operators to complete the challenge were all introduced within the last fourteen challenges previously.
To make it a little more understandable, how does this rewrite of the challenge sound
In this challenge, we will test your knowledge of the math operators you've learned so far.
Write code to convert from the Celsius temperature to Fahrenheit. The algorithm that converts Celsius to Fahrenheit is the Celsius temperature times
9/5
, plus32
.We'll use the function
convertToF
around your code. In short, functions allow us to reuse code. So now your code can convert many different temperatures.convertToF(30); // Converts 30 C to 86 F convertToF(0); // Converts 0 C to 32 F
Use the variable
fahrenheit
and apply the temperature conversion algorithm. Then assign the resulting temperature to the variablecelsius
. The variablecelsius
will then represent the Fahrenheit temperature in Celsius.Note
Don't worry too much about thefunction
andreturn
statements. Future challenges will cover them. For now, only use operators that you have already learned.
cc/ @FreeCodeCamp/issue-moderators feedback on the rewrite and issue? Too complicated of instructions? Rewrite unnecessary?
I agree
I am a complete beginner. I worked it out with the exception of putting the division in brackets. I had to search for a solution.
I thought it was a little advanced but I am learning a lot from FreeCodeCamp. I would have never thought to put both words in line 5. I was close, but celsius did not register at all (I had fahrenheit in there). And I do appreciate you guys making the changes that you did because it would have been way too hard. I am brand new and have only been coding for 4 weeks. But more than anything, thanks for building and providing freeCodeCamp because it is the one platform that is really moving things a long for me. And thanks for having more resources on Github!!
I found this lesson to be too advanced at the time I attempted it. My feeling is the lesson asks you to do something novel (I don't think the previous lessons fully prepare you) combined with some new code that the student likely doesn't understand.
I 'solved' it by googling this thread and looking at the above solution.
Should be taken up in the curriculum expansion?
/cc @FreeCodeCamp/moderators
I think Convert Celsius to Fahrenheit should be moved right after Finding a Remainder in JavaScript challenge.
I think this surprise question after some challenges related to shorthand operators is the issue in a subtle way.
I'm going to link to @abhisekp 's comment over in the Curriculum Expansion issue 14 here - it held all the discussion about the existing JavaScript section. The issue is closed, but there are a handful of new challenges that need to be seeded I have noted as a to-do. We can do any proposed challenge re-orders for that section, too, at that time.
As a new commer I was totally confused with this exercise. Thanks for your help everyone.
Yeah, I'll fourth, or fifth on this issue. I'm here to get certifications and learn more, but I've been modifying javascript and other programming languages such as PHP for probably as long as it's been around, and yet this was not clear to me how to solve it until I got to this github thread. Mind you, I'm not very 'instinctual' with math, but I do see how this works now, however I wouldn't have expected to be applying core math in such a way so early on. I figured it would have been a simple, single line of code, but I think more preparation should DEFINITELY have been done for me to be able to do this right off the bat...(maybe prep the student that you will be applying direct math to this set of lessons?) All of the other lessons seem to teach you in a very flowing manner. This one, either should have a mini lesson in front of this, or place it later on. My two cents.
Yep...This challenge totally had me confused.
@jacob-on-github I liked that I saw the other stuff as you mentioned.
However the use of the var fahrenheit; declaration fooled me a bit. Also the wording "You are given a variable celsius representing a temperature in Celsius. " confused me a bit. I might have solved this without that bit of information.
Regardless - I finally solved it using search - read - ask and even if I had to go find the answer so that I was seeing it to understand it - I think as part of the learning process thats all ok.
How should we continue with this issue? I think moving it as @abhisekp suggested would be the way to go.
Should be mark that as help wanted here, or should we move this to the curriculum expansion?
Content Hidden - by mod [raisedadead]
not woking plz help
@Meenusaro please use the chat rooms.
I agree that the challenge is complicated to a degree. I am new to coding and have only been really going "full board" 3 weeks. I am here because I was looking for an explanation like many others. On the other hand though, ( question for front-end, full-stack and back-end programmers) doesn't this also teach to think like a programmer? Many times there will be things we don't understand that we will have to figure out a solution for. I am glad that this is here because even though I didn't understand it right away, searching for a result has helped me understand the challenge more clearly. Thanks to those who explained what was actually going on. I got value out of it and it helped me get past the issue!
Campers are clearly having trouble with this challenge.
We could move it over to the basic algorithm challenges and make it the first one, since it is quite easy compared to the other ones. At least this way campers would be a bit farther into the curriculum and would be ready to tackle it.
Skipping it, there is no previous lesson that prepared me for this. I feel dumber than a rock atm.
you guys are killin' me
Most helpful comment
@jacob-on-github - good idea! I think many newcommers would really appreciate that little bit of explanation, or even some modification of a challenge.
Sorry for any flaws in my grammar :)
My proposal:
Add to description:
Change the challenge:
This proposal cuts off a lot of code, but won't scare off people who are real beginners. When filled with proper solution
fahrenheit = celsius * (9/5) + 32
it will give necessary output, acceptable by checking algorithms (I've checked it).