forked from Daoud-Hussain/University-Management-System
-
Notifications
You must be signed in to change notification settings - Fork 1
/
CafeManagement.java
60 lines (50 loc) · 1.73 KB
/
CafeManagement.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// package university;
import java.util.*;
public class CafeManagement{
static Scanner input = new Scanner(System.in);
static Main mainClass = new Main(); // main class object
static Cafe cafeObj = new Cafe();
static void manage(String regNumber){
System.out.println("\n*******************************************************\n");
System.out.println("\tCafe Management System\n");
System.out.println("*******************************************************\n");
System.out.println("1. Display Menu");
System.out.println("2. Previous Menu");
System.out.println("3. Exit");
System.out.println();
while(true){
try{
System.out.print("Enter your choice : ");
int c = input.nextInt();
boolean valid=false;
switch(c){
case 1 : {
cafeObj.manage(regNumber);
valid = true;
break;
}
case 2 : {
mainClass.management(regNumber);
valid = true;
break;
}
case 3 : {
System.exit(0);
break;
}
}
if(valid){
break;
}
else{
System.out.println("Invalid choice! Try Again");
input.nextLine();
}
}
catch(Exception e){
System.out.println("Invalid choice! Try Again");
input.nextLine();
}
}
}
}