/*may be now a bit better */ package aaaa; import - TopicsExpress



          

/*may be now a bit better */ package aaaa; import java.util.Scanner; public class bbbb { public static void main(String[] args) { Scanner scn = new Scanner (System.in); boolean loop = true; String MENU; while (loop) { System.out.println("entr a menu " ); System.out.println("A:SHORTCUTS"); System.out.println("B:VARIABLES"); MENU=scn.next(); if (MENU.equals("q") || MENU.equals("Q")){ loop=false; System.out.println("exit"); } else { switch (MENU) { case "a" : case "A" : System.out.println("how to use shortcuts"); System.out.println("please choose"); System.out.println("1:write System.out.printlm(); with a shortcut"); System.out.println("2:write String[] args with a shortcut"); System.out.println("3:import scanner with a short"); int i=scn.nextInt(); switch (i){ case 1: System.out.println("type sysout and ctrl+space"); break; case 2: System.out.println("type main and ctrl+space+enter"); break; case 3: System.out.println("type scanner and ctrl+space"); break; default: System.out.println("THINK BETTER !!!"); break; }; break; case "b": case "B": System.out.println("how to declare varibles"); System.out.println("1: integers and doubles"); System.out.println("2: string and characters"); int j=scn.nextInt(); switch (j){ case 1:{ System.out.println("int x=0"); System.out.println("double y=0"); } break; case 2: { System.out.println("String str="" "); System.out.println("Char ch= "" "); } break; default: System.out.println("THINK BETTER !!!"); break; } break; // case "q": // case "Q":System.out.println("enter Q to quit"); break; default: System.out.println("THINK BETTER !!!"); } } } } }
Posted on: Mon, 19 Aug 2013 08:00:56 +0000

Trending Topics



Recently Viewed Topics




© 2015