FAQ: Variables - Challenge: Temperature (Part 1)


This community-built FAQ covers the “Challenge: Temperature (Part 1)” exercise from the lesson “Variables”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Learn C++

FAQs on the exercise Challenge: Temperature (Part 1)

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

C++ is FINALLY here on CodeCademy!

Every other step has been cleared, but when compiling I suddenly get a slew of errors saying every time I wrote tempf or tempc there were two or more data (the error trails off the screen) in declaration of ‘tempc’ or ‘tempf’. But the code was entered correctly every other step, so what is the issue now?


This is dogshit. Why am I not able to use endl, using namespace std, etc. Really aggravating me that you can’t use unique solutions. Whoever made it so there can’t be more than one way to solve it is ■■■■■■■■. I’m sorry for my anger, but over time it gets really irritating.


I’m sorry you dislike the syntax preferences of Codecademy, but what they do is they stick with one form of syntax, and that syntax can be annoying for most of us, even though it’s actually valid.

The code you make outside of Codecademy is fine, no matter what way you use the syntax.

#include <iostream>
using namespace std;

int main() {
    cout << "Hello World!" << endl;
    return 0;


But in Codecademy, you’re forced to use their syntax, and not what you choose.

#include <iostream>

int main() {

    std::cout << "Hello World!\n";

    return 0;


If you choose to learn from Codecademy, then you’ll probably have to use their syntax to proceed. It may seem terrible to you, but it’s fine.

Because when you complete their courses, you can choose whatever valid form of syntax you choose.


Step 4 needs to be a little more explicit in its instruction. How should we compile,

$ g++ temperature.cpp
$ ./a.out


$ g++ temperature.cpp -o temperature
$ ./temperature

It would appear the first one is the way to go. Has anyone succeeded using the other?


hey @leonhardeuler9754768 this is sonny, the curriculum developer for this course. i definitely want to allow different solutions. this is something im definitely going to tackle.

it’s going to take me a few days to add two additional tests for each one of the checkpoints. will do it asap.


hey @kapow512, can you copy and paste your code in here so i can take a look? thank u~


@mtf hey roy, looking into it!


u are right! im adding the test for the second one right now and also adding a hint.

UPDATE: fixed.