Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 94 - 2625 PortGPt V2.1
P. 94

    Program 8: To check whether a student’s performance is good, better or best.

                      <!DOCTYPE HTML>
                      <HTML>

                      <HEAD>
                          <TITLE> Switch Statement2 </TITLE>
                      </HEAD>

                      <BODY>
                      <SCRIPT>
                        var choice = parseInt(prompt("Enter 1 for Good / 2 for better / 3 for
                      best"));
                        switch(choice)
                        {

                             case 1:
                               document.write("Good");
                               break;

                             case 2:
                               document.write("better");
                               break;

                             case 3:
                               document.write("best");

                               break;

                             default:
                                document.write("invalid");
                        }

                      92    Premium Edition-VIII

| 89 90 91 92 93 94 95 96 97 98 99 |