Tag:long exit package ann oid Applications applications class data
/*****
* Design a DOS application that simulates the use of menus, which allows the user to select and re-select when the error is selected.
* @author Yanlong
* 2017/5/5
*/
Package java3;
Import Java.util.Scanner;
public class Liti3_12 {
public static void Main (string[] args) {
Char a;//defines the escape character
System.out.println ("--system function--");
System.out.println ("1. Query function");
System.out.println ("2. Input function");
System.out.println ("3. Printing function");
System.out.println ("4. Modify data");
System.out.println ("5. Sign out");
SYSTEM.OUT.PRINTLN ("Please select");
bo=
Scanner a1=new Scanner (system.in);
A=a1.next (). charAt (0);
Switch (a) {
Case ' 1 ':
System.out.println ("querying");
Case ' 2 ':
System.out.println ("entering");
Case ' 3 ':
System.out.println ("Printing");
Case ' 4 ':
System.out.println ("revising");
Case ' 5 ':
System.out.println ("Good-bye");
Default
SYSTEM.OUT.PRINTLN ("Illegal! Please re-select ");
}
}while (a!= ' 5 ');
}
}
Java Design Simulation Menu