-
Notifications
You must be signed in to change notification settings - Fork 2
/
landingClass.java
74 lines (56 loc) · 1.58 KB
/
landingClass.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import java.util.Scanner;
public class landingClass {
public static void menu() {
Scanner sc = new Scanner(System.in);
bool done = false;
while (!done) {
try {
System.out.println("*************Welcome to your very own Gift Shop*************\n MAIN MENU");
System.out.println("1. New to our Shop? Create an account.");
System.out.println("2. Log in to check out the cool gifts");
System.out.println("3. Admin Login");
System.out.println("4. Exit");
System.out.println("Press the number corresponding to your choice");
String getValue;
getValue = sc.nextLine();
int choice;
try {
choice = Integer.parseInt(getValue);
} catch (Exception e) {
choice = 5;
}
switch (choice) {
case 1:
// Verify with signup class.
SignUp newUser = new SignUp();
newUser.sign(sc);
break;
case 2:
// Verify with LogIn class
LogIn currUser = new LogIn();
currUser.login(sc);
break;
case 3:
// Verify with VerifyAdmin class.
VerifyAdmin admin = new VerifyAdmin();
break;
case 4:
done = true;
break;
default:
System.out.println("Incorrect Choice.\n Please enter an integer between 1 and 4.");
break;
}
}
catch (Exception e) {
System.out.println("Err.. Something went wrong, please report the following error to the admin");
System.out.println(e);
}
}
}
public static void main(String[] args) {
// TODO Auto-generated method stub
menu();
System.out.println("Thank you for visiting. Hope to see you soon. Have a good day");
}
};