Codecademy problem

A place to discuss the implementation and style of computer programs.

Moderators: phlip, Moderators General, Prelates

Posts: 1
Joined: Mon Apr 14, 2014 1:54 pm UTC

Codecademy problem

Postby Code0 » Mon Apr 14, 2014 1:56 pm UTC

Hello, I am working on a java program for CodeCademy. Here is what it is:

Code: Select all

console.log ("You are at a Justin Bieber concert, and you hear this lyric 'Lace my shoes off, start racing.'");
console.log("Suddenly, Bieber stops and says, 'Who wants to race me?'");
var userAnswer = prompt("do you want to race bieber");

if (userAnswer === "yes")
    console.log ("Bieber start racing. It's neck and neck! You win by a shoelace!");

    console.log ("Oh no! Bieber shakes his head and sings 'I set a pace, so I can race without pacing.'");

Can you find anything wrong? I can't get it right.
Last edited by phlip on Tue Apr 15, 2014 3:48 am UTC, edited 1 time in total.
Reason: Changed topic title to be more useful, and added [code] tags

User avatar
Restorer of Worlds
Posts: 7572
Joined: Sat Sep 23, 2006 3:56 am UTC
Location: Australia

Re: Help with java!

Postby phlip » Tue Apr 15, 2014 3:46 am UTC

Code0 wrote:Can you find anything wrong? I can't get it right.

The code you have seems fine to me... what are you expecting it to do, and what's it doing that you aren't expecting?

(Also, for future reference: Java and JavaScript are completely different languages, despite the confusing names... this code is in JavaScript, not Java.)

OK, so I found the course this thing is for... it seems that the problem is that you're supposed to keep all your code from the previous steps of the lesson intact... so your program needs to do everything you've done so far - the confirm() call, then asking the user's age, and then the Bieber race stuff.

Code: Select all

enum ಠ_ಠ {°□°╰=1, °Д°╰, ಠ益ಠ╰};
void ┻━┻︵​╰(ಠ_ಠ ⚠) {exit((int)⚠);}

Return to “Coding”

Who is online

Users browsing this forum: No registered users and 13 guests