switch functions

switch functions

View Answers

September 30, 2008 at 11:53 AM

Hi friend,


This is running code,


<html>
<head>
<title>switch option using in javaSctipt</title>

</head>

<body>
<script type="text/javascript">
var n=0;
n=prompt("Enter your month of hire:")
switch(n)
{
case(n="January"):
document.write("Last vacation accrual 2008 is July, PTO award January 2009 is 50 hours");
break
case(n="February"):
document.write("Last vacation accrual 2008 is August, PTO award January 2009 is 40 hours");
break
case(n="March"):
document.write("Last vacation accrual 2008 is September, PTO award January 2009 is 30 hours");
break
case(n="April"):
document.write("Last vacation accrual 2008 is October, PTO award January 2009 is 20 hours");
break
case(n="May"):
document.write("Last vacation accrual 2008 is November, PTO award January 2009 is 10 hours");
break
case(n="June"):
document.write("Last vacation accrual 2008 is December, PTO award January 2009 is 0 hours");
break
case(n="July"):
document.write("Last vacation accrual 2008 is July, PTO award January 2009 is 50 hours");
break
case(n="August"):
document.write("Last vacation accrual 2008 is August, PTO award January 2009 is 40 hours");
break
case(n="September"):
document.write("Last vacation accrual 2008 is September, PTO award January 2009 is 30 hours");
break
case(n="October"):
document.write("Last vacation accrual 2008 is October, PTO award January 2009 is 20 hours");
break
case(n="November"):
document.write("Last vacation accrual 2008 is November, PTO award January 2009 is 10 hours");
break
case(n="December"):
document.write("Last vacation accrual 2008 is December, PTO award January 2009 is 0 hours");
break
}
</script>
</body>
</html>


----------------------------------------------

Thanks.









Related Tutorials/Questions & Answers:
switch functions - Java Beginners
switch functions  I am writing a script for use in a computer based... your month of hire:") switch(n) { case(n="January"): document.write("Last... friend, This is running code, switch option using in javaSctipt
switch statement
switch statement   i want to write a java program that computes Fibonacci,factorial,string reversal and ackerman using switch case to run as a single program
Advertisements
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
switch case
switch case  program to input 2 numbers and a choice.Using switch case we need to perform all the mathematical operation.Print a suitable error message if the choice is wrong
Switch databases
Switch databases  How do you inter-change between relational databases without code changes
Switch
Switch      ... statements. To avoid this we can use Switch statements in Java. The switch statement... of a variable or expression. The switch statement in Java is the best way to test
The Switch statement
Switch       Sometimes.... To avoid this we can use Switch statements in Java. The switch statement is used... of a variable or expression. The switch statement in Java is the best way to test
Switch Statement
Switch Statement  How we can use switch case in java program ?   Note:-Switch case provides built-in multiway decision statement.It...); switch(days){ case 1: System.out.println("Sunday
programes on switch
=input.nextInt(); switch(choice){ case 1
Switch Statement with Strings in Java
Switch Statement with Strings in Java  Switch Statement with Strings in Java
Java switch statement
Java switch statement  What restrictions are placed on the values of each case of a switch statement
switch case instead of if else
switch case instead of if else  How to write code in switch case instead of if else in Java
ModuleNotFoundError: No module named 'switch'
ModuleNotFoundError: No module named 'switch'  Hi, My Python... 'switch' How to remove the ModuleNotFoundError: No module named 'switch'... to install padas library. You can install switch python with following command
ModuleNotFoundError: No module named 'switch'
ModuleNotFoundError: No module named 'switch'  Hi, My Python... 'switch' How to remove the ModuleNotFoundError: No module named 'switch'... to install padas library. You can install switch python with following command
using switch,break and for loop
using switch,break and for loop  generate a 10 digit number and display the length of longest increasing series
Switch statement in PHP
Switch statement in PHP  HII, Explain about switch statement in PHP?   hello,ADS_TO_REPLACE_1 Switch statement is executed line by line... of the switch expression. It does execute the statement until the end of the block
using switch and break
using switch and break  generate a 10 digit number and display the length of longest increasing series
Switch case + condition??
Switch case + condition??  I try to use a switch case with condition but it doesn't display anything have look: ......public void commandAction...(); } } else { List down = (List)display.getCurrent(); switch
using switch case
using switch case  Define a class MENU to perform the following operation depending upon the users choice using switch case 1)print square root... choice: "); int choice=input.nextInt(); switch(choice
Switch case in Jsp page
Switch case in Jsp page  <table> <tr><td>Enter Distance :</td> <td><input type="text" name="dis"/></td>... using switch case in jsp page
ModuleNotFoundError: No module named 'e-switch'
ModuleNotFoundError: No module named 'e-switch'  Hi, My Python...-switch' How to remove the ModuleNotFoundError: No module named 'e-switch... to install padas library. You can install e-switch python with following
ModuleNotFoundError: No module named 'pi_switch'
ModuleNotFoundError: No module named 'pi_switch'  Hi, My Python..._switch' How to remove the ModuleNotFoundError: No module named 'pi_switch' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'pulseaudio-switch'
ModuleNotFoundError: No module named 'pulseaudio-switch'  Hi, My... named 'pulseaudio-switch' How to remove the ModuleNotFoundError: No module named 'pulseaudio-switch' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'switch-model'
ModuleNotFoundError: No module named 'switch-model'  Hi, My Python... 'switch-model' How to remove the ModuleNotFoundError: No module named 'switch-model' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ybc-switch'
ModuleNotFoundError: No module named 'ybc-switch'  Hi, My Python... 'ybc-switch' How to remove the ModuleNotFoundError: No module named 'ybc-switch' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'e-switch'
ModuleNotFoundError: No module named 'e-switch'  Hi, My Python...-switch' How to remove the ModuleNotFoundError: No module named 'e-switch... to install padas library. You can install e-switch python with following
ModuleNotFoundError: No module named 'js.bootstrap-switch'
ModuleNotFoundError: No module named 'js.bootstrap-switch'  Hi, My... named 'js.bootstrap-switch' How to remove the ModuleNotFoundError: No module named 'js.bootstrap-switch' error? Thanks   Hi
ModuleNotFoundError: No module named 'enum-switch'
ModuleNotFoundError: No module named 'enum-switch'  Hi, My Python... 'enum-switch' How to remove the ModuleNotFoundError: No module named 'enum-switch' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'js.bootstrap-switch'
ModuleNotFoundError: No module named 'js.bootstrap-switch'  Hi, My... named 'js.bootstrap-switch' How to remove the ModuleNotFoundError: No module named 'js.bootstrap-switch' error? Thanks   Hi
ModuleNotFoundError: No module named 'mongo-switch'
ModuleNotFoundError: No module named 'mongo-switch'  Hi, My Python... 'mongo-switch' How to remove the ModuleNotFoundError: No module named 'mongo-switch' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'nose-switch'
ModuleNotFoundError: No module named 'nose-switch'  Hi, My Python... 'nose-switch' How to remove the ModuleNotFoundError: No module named 'nose-switch' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'smt-switch'
ModuleNotFoundError: No module named 'smt-switch'  Hi, My Python... 'smt-switch' How to remove the ModuleNotFoundError: No module named 'smt-switch' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'switch-case'
ModuleNotFoundError: No module named 'switch-case'  Hi, My Python... 'switch-case' How to remove the ModuleNotFoundError: No module named 'switch-case' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'switch-case'
ModuleNotFoundError: No module named 'switch-case'  Hi, My Python... 'switch-case' How to remove the ModuleNotFoundError: No module named 'switch-case' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'switch-inputs'
ModuleNotFoundError: No module named 'switch-inputs'  Hi, My... 'switch-inputs' How to remove the ModuleNotFoundError: No module named 'switch-inputs' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'switch-mexico'
ModuleNotFoundError: No module named 'switch-mexico'  Hi, My... 'switch-mexico' How to remove the ModuleNotFoundError: No module named 'switch-mexico' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'switch-payments'
ModuleNotFoundError: No module named 'switch-payments'  Hi, My... named 'switch-payments' How to remove the ModuleNotFoundError: No module named 'switch-payments' error? Thanks   Hi, In your python
ModuleNotFoundError: No module named 'ugly-switch'
ModuleNotFoundError: No module named 'ugly-switch'  Hi, My Python... 'ugly-switch' How to remove the ModuleNotFoundError: No module named 'ugly-switch' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'enum-switch'
ModuleNotFoundError: No module named 'enum-switch'  Hi, My Python... 'enum-switch' How to remove the ModuleNotFoundError: No module named 'enum-switch' error? Thanks   Hi, In your python environment
ModuleNotFoundError: No module named 'Flask-Switch'
ModuleNotFoundError: No module named 'Flask-Switch'  Hi, My Python... 'Flask-Switch' How to remove the ModuleNotFoundError: No module named 'Flask-Switch' error? Thanks   Hi, In your python
Version of com.braintreepayments>browser-switch dependency
List of Version of com.braintreepayments>browser-switch dependency
Version of com.braintreepayments>browser_switch dependency
List of Version of com.braintreepayments>browser_switch dependency
Switch Case - Java Interview Questions
Switch Case  int x=100000; switch(x) { case 100000: printf("Lacks"); } output= Lacks I want reason why x matches switch case although range for int is in between something -32678 to +32676. Plz give me ans quickly
switch Java Keyword
switch Java Keyword       The switch is a keyword defined in the java programming language. Keywords... in java programming language likewise the switch keyword indicates the following
change color of back ground using switch
change color of back ground using switch   how to change back ground color according to day using switch case
switch CAPSLOCK button in my progranm...
switch CAPSLOCK button in my progranm...  I found that function which does the Capslocks job,when am running my program if the capslock button... the capslocks switch button to become a button that i can switch it between on and off
ModuleNotFoundError: No module named 'aws-cloudformation-power-switch'
ModuleNotFoundError: No module named 'aws-cloudformation-power-switch' ...: ModuleNotFoundError: No module named 'aws-cloudformation-power-switch' How to remove the ModuleNotFoundError: No module named 'aws-cloudformation-power-switch' error
ModuleNotFoundError: No module named 'django-lang-switch'
ModuleNotFoundError: No module named 'django-lang-switch'  Hi, My... named 'django-lang-switch' How to remove the ModuleNotFoundError: No module named 'django-lang-switch' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'django-lang-switch'
ModuleNotFoundError: No module named 'django-lang-switch'  Hi, My... named 'django-lang-switch' How to remove the ModuleNotFoundError: No module named 'django-lang-switch' error? Thanks   Hi, In your
ModuleNotFoundError: No module named 'microhomie-node-switch'
ModuleNotFoundError: No module named 'microhomie-node-switch'  Hi...: No module named 'microhomie-node-switch' How to remove the ModuleNotFoundError: No module named 'microhomie-node-switch' error? Thanks   Hi

Ads