Switch Case examples

 import java.util.Scanner;


public class SwitchJava {


public static void main(String[] args) 

{

System.out.println("press 1 for balance enquiry");

System.out.println("press 2 for re fill");

System.out.println("press 3 for value added services");

System.out.println("press 4 for know more");

System.out.println("press 5 for navigating to previous menu");

System.out.println("press 6 for talk to out customer care");

Scanner sc=new Scanner(System.in);

int val = sc.nextInt();

switch(val)

{

case 1:

System.out.println("available balance in 973.34 rupee");

break;

case 2:

System.out.println("you have recharger with 100 rupees coupan");

break;

case 3:

System.out.println("your request for change caller tune proceed");

break;

case 4:

System.out.println("new service information should provided");

break;

case 5:

System.out.println("redirecting you to previous menu");

break;

case 6:

System.out.println("please wait your call forwarded to our representative");

default:

System.out.println("please choose an option");

break;

}

}


}

Comments

Popular posts from this blog

#Prime #Numbers

palindrome part 2(reverse an String)