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 () 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 () below!
You can also find further discussion and get answers to your questions over in Language Help.
Agree with a comment or answer? Like () to up-vote the contribution!
I am constantly have issues were no matter what I do the code I entered is wrong even though I’m getting the correct output. I have reported it as a bug multiple times but Code-academy.com seems to not care. This is the reason I refuse to pay for pro, if the free version does not work right half the time why would the pro version be any different.
}
when using 1337 or 0000 the code works, but when using 0310 it says that the passcode is incorrect. anyone has idea why so? edit: i noticed, when putting in 0310 it appears as int 200, so when u enter 200 it is correct for some reason
Interesting! I was also curious about the literal integer. Why did they use the leading zero “0310”? and why does the code stop working if I change it to "enter_code (310) without the leading zero?? Well…
I discovered that in c++ when you enter an integer literal with a leading zero, the compiler interprets it as an octal number (base 8). Octal 0310 = decimal 200. So if you leave the passcode == 0310, and change it to "enter_code(200) it works, because decimal 200 = Octal 0310. Cool. Learn something everyday.
Just a quick note for a suggestion in improving the lesson text. In first example it says:
" When this program is compiled and executed, sea_animal will print, but animal won’t. Why do you think that’s the case?".
This isn’t quite right. Code actually won’t compile because “animal” declaration isn’t available within main the way it is declared in the example. I confirmed on both Codecademy compiler and my desktop.