
—————————Full Source Code————————
//Programmer: Akinwale Owi
//Company: Dagba Computers
//Program Purpose: Switch Statement Example in Java
package dagba.computer.sample;
/**
*
* @author Akin
*/
//imports
import java.util.Scanner;
public class DagbaComputerSample {
/**
* @param args the command line arguments
*/
public static void main(String[] args)
{
//Creating the Scanner we will read the user’s choice with
Scanner clientChoice = new Scanner(System.in);
//Asking the user a question
System.out.println(“Welcome to my menu! Please enter choice below:”);
System.out.println(“Enter 1 for keyboard review”);
System.out.println(“Enter 2 for mouse review”);
System.out.println(“Enter 3 for monitor review”);
System.out.println(“————————“);
//Reading in their response
int client = clientChoice.nextInt();
switch (client)
{
case 1:
System.out.println(“Ours are comfortable”);
break;
case 2:
System.out.println(“Fit your hand perfectly”);
break;
case 3:
System.out.println(“Clear as day”);
}
}//end of main function
}//end of DagbaComputerSample Class