Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 5 of 5

Thread: Codecademy Problem

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Codecademy Problem

    Hi my name is david, i want to know if anyone can help me out with this code, i do not know whats wrong with it. Please

    var verificarCredito = function (ingresos) {
    if (ingresos >= 100);
    console.log ("¡Ganas mucho dinero! Estás calificado para manejar una tarjeta de crédito.");

    else
    {
    console.log ("Desgraciadamente no estás calificado para manejar una tarjeta de crédito. El capitalismo es así de cruel.");
    }

    }
    verificarCredito (75);
    verificarCredito (125);
    verificarCredito (100);


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Codecademy Problem

    Javascript is not the same as java

    You need to explain what the problem is.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Codecademy Problem

    oh.....so sorry...ok thank you Norm....


    lets see...it tells me..."SyntaxError: Unexpected token else".

    i took the else out, just to see what could happen, but codecademy wont let me advance, because it needs to see what would happen when varCredito is lower than 100.

  4. #4
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Codecademy Problem

    Please post your code correctly in code tags and properly indented.

  5. #5
    Junior Member
    Join Date
    Nov 2012
    Location
    Sandwich
    Posts
    14
    My Mood
    Yeehaw
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Codecademy Problem

    Check the structure of your if statement. The problem is in there

Similar Threads

  1. Catch block problem. Please fix my problem.
    By damnitsme in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 3rd, 2014, 01:49 AM
  2. Problem with Project Euler problem 18
    By sara_magdy in forum What's Wrong With My Code?
    Replies: 2
    Last Post: July 19th, 2013, 12:46 PM
  3. Replies: 3
    Last Post: January 5th, 2012, 01:44 AM
  4. [SOLVED] [Problem] imports javax.swing problem
    By Brollie in forum AWT / Java Swing
    Replies: 8
    Last Post: July 5th, 2009, 07:59 AM