Jump to content

Code academy help? (Java)


driveyou

Recommended Posts

Hey I'm trying to get into programming, want to learn how to create scripts eventually and im stuck on a certain part, and theres no get hint bar..

 

 

here's the instructions: 

So your story is really moving along! There is a scene. Your user is about to talk to Batman. You want to see if your user is ready to smackdown with Batman.

Instructions
  1. Under your existing code, print out the storyline: "Batman glares at you."
  2. Then declare a variable userAnswer. Make it equal a prompt that asks the user "Are you feeling lucky, punk?". This will be the question that Batman asks your user.

 

 

Here's my code: 
 

// Check if the user is ready to play!
confirm("I am ready to play!");
var age = prompt("What's your age?");

if (age < 18) {
    
    console.log("Play responsibily");
}

else {
    
    console.log("Play on!");
}
console.log("Snow White and Batman were hanging out at the bus stop, waiting to go to the shops. There was a sale on and both needed some new threads. You've never really liked Batman. You walk up to him.");
console.log('Batman glares at you');

var userAnswer = prompt("Are you feeling lucky, punk?");




Im not sure what im doing wrong, please help :) Thanks

Link to comment
Share on other sites

Everything looks fine.

You forgot a period in the var 'Batman glares at you.' Btw, this is JavaScript not Java.

 

oh alright, thanks! :) and woops my bad :P

 

 

Yes, everything is fine. I did this exercise on Codecademy and it was working properly. Btw, like Celestial said, this is Javascript which is used for websites. You want to learn Java for scripting tongue.png

 

 

cheers man :P 

 

<3 cody academy 

Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...