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 2 of 2

Thread: Please help with this java script code so it validates.?

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

    Default Please help with this java script code so it validates.?

    /*script that provides a message to the user for a grade that is entered*/

    function checkGrade( )
    {
    var grade = prompt("Enter a Letter Grade:","");
    /* Enter grade A, B, C, D, or f*/
    switch (grade)
    break;
    {
    case "A":
    alert("Your grade is excellent.");
    break;
    case "B":
    alert("Your grade is good.");
    break;
    case "C":
    alert("Your grade is average.");
    break;
    case "D":
    alert("You are barely passing.");
    break;
    case "F":
    alert("You failed.");
    break;
    }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,146
    My Mood
    Mellow
    Thanks
    187
    Thanked 660 Times in 647 Posts

    Default Re: Please help with this java script code so it validates.?

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

Similar Threads

  1. Java Script or HTML
    By ravi9999 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 1st, 2012, 09:44 AM
  2. Need Java code to be used in Selenium Script
    By anujbatta in forum What's Wrong With My Code?
    Replies: 1
    Last Post: May 25th, 2011, 10:50 AM
  3. Downloading web page with java script enabled through Java
    By mashimaro in forum Java Networking
    Replies: 1
    Last Post: November 13th, 2010, 08:28 PM
  4. Related to Html and Java Script?
    By JackyRock in forum JavaServer Pages: JSP & JSTL
    Replies: 2
    Last Post: February 17th, 2010, 02:10 AM