Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners switch functions

Have Programming Question? Ask it here!
 
 
 


Lydia
switch functions
1 Answer(s)      5 years and 7 months ago
Posted in : Java Beginners



Advertisement
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
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
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 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
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
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
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance
What is functions?
What is functions?  Hi, Please tell me about PHP functions? Thanks in advance.   About Functions: Functions in PHP is block of code... functions and use it multiple times. In PHP there is many pre-defined functions
Switch statement in PHP
Switch statement in PHP  HII, Explain about switch statement in PHP?   hello, Switch statement is executed line by line. PHP executes the statement only when the case statement matches the value of the switch
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
using switch and break
using switch and break  generate a 10 digit number and display the length of longest increasing series
Inbuild functions
Inbuild functions  List all the inbuild functions in java
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
Functions and Methods
Functions and Methods  (1) Write a program in java to input 10... the day number from the main class. The function uses a switch-case statement... using switch case statement. import java.util.*; class FindDay { public
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
Functions and Methods
Functions and Methods  Write a Java program to input the sides of a triangle. Pass the sides to a function decide(int x,int y,int z) which checks and prints whether the triangle is equilateral,isosceles or scalene.   
static functions
static functions  Give some brief defenition for 1. Static Variables 2. Static Functions 3. Instance Variable  Static Variables Static variables are class variables that are shared by all instance of class .. 1
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
PHP Functions, PHP Functions Tutorials
PHP Functions In this section we will understand important PHP functions with the help of example code. What is Functions? Function is a block of code...; } Functions in PHP PHP provides many built-in functions to do the real job
Boolean functions in JavaScript
Boolean functions in JavaScript  Explain about the Boolean functions present in Javascript
What are encryption functions in PHP?
What are encryption functions in PHP?  What are encryption functions in PHP
decodeURI() and encodeURI() functions in JavaScript
decodeURI() and encodeURI() functions in JavaScript  What are decodeURI() and encodeURI() functions in JavaScript
functions strstr() and stristr().
functions strstr() and stristr().  What is the functionality of the functions strstr() and stristr
the functions unlink and unset
the functions unlink and unset  What is the difference between the functions unlink and unset
Boolean functions present in Javascript
Boolean functions present in Javascript   Explain about the Boolean functions present in Javascript
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
Switch Statement example in Java
Switch Statement example in Java    ... for implementing the switch statement. Here, you will learn how to use the switch statement... more about the switch statement in Java. The following java program tells you
using if and switch stmt - Java Beginners
using if and switch stmt  A cloth showroom has announced... be assumed. Write a program using "switch and if statement" to compute net amount...(); switch(menu) { case 1: System.out.print("Quantity: "); int q1 = scan.nextInt
switch Statement - Overview
Java Notes switch Statement - Overview Purpose of switch: select one of many possible statements to execute... on a boolean value (only two possible values). The switch statement allows
php stream functions
php stream functions  what does php stream functions do
JavaScript Variadic functions
JavaScript Variadic functions  Explain about Variadic functions
php array functions
php array functions  php array functions list
What is Character Functions
What is Character Functions  What is Character Functions   Hi, Here is the answer, Character Functions are INITCAP, UPPER, LOWER, SUBSTR & LENGTH. Additional functions are GREATEST & LEAST. Group Functions
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
PHP Switch Case
Switch Case Control Structure: Almost every modern language supports switch case control structure. It is similar to if statements. Switch case is useful... should know how the switch case works, in switch case every case is considered
c-language pointer functions
c-language pointer functions  what is the execution process of character pointer functions with example
Confusion on Functions. Help Please?!
Confusion on Functions. Help Please?!  Write a program which has a number of functions for getting the area i.e. area of circle, area of square, area of rectangle and area of cylinder. Right, I've got some of it, but I'm just
Java Switch Statement
Java Switch Statement       In java, switch is one of the control statement which turns the normal flow... then switch statement can be used. It checks your choice and jump on that case label
php oop functions
php oop functions  Just a quick question... php oop functions. can i call the main class function from an instantiated object of the child class
without using built-in functions
without using built-in functions  Hai sir... Please help me to solve this... Findout occurances of each string in every another string (built - in functions are not at all allowed) all, and, sand, falling wall and sand
Switch case in java
Switch case in java In this section we will learn about switch case in java..., and java, switch case is used . switch  is a selection control mechanism used... if statement, switch allow the user to select a option from multiple options
 

 

 

DMCA.com