-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathProjectTrial.java
109 lines (102 loc) · 3.75 KB
/
ProjectTrial.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package project.trial;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Scanner;
/**
*
* @author jana
*/
public class ProjectTrial {
/**
* @param args the command line arguments
*/
public static void main(String[] args) throws IOException{
Admin ParentAdmin = new Admin(101, "Admin@Parent101", "Parent_Admin");
Scanner s = new Scanner(System.in);
boolean homepage = true;
Vehicle.initializeAvailibilityMap();
while(true)
{
int who = ParentAdmin.Login();
while(homepage)
{
switch(who)
{
case(1):
{
System.out.println("Welcome Admin. What would you like to do: ");
System.out.println("1. Manage Vehicles");
System.out.println("2. Manage Trips");
System.out.println("3. Manage Users");
int response = s.nextInt();
s.nextLine();
switch(response)
{
case 1:
{
Admin.managesVehicle();
System.out.println("Would you like to return to home page?");
String home = s.nextLine();
if(!home.equalsIgnoreCase("yes"))
{
homepage = false;
}
break;
}
case 2:
{
Admin.managesTrips();
System.out.println("Would you like to return to home page?");
String home = s.nextLine();
if(!home.equalsIgnoreCase("yes"))
{
homepage = false;
}
break;
}
case 3:
{
Admin.manageUsers();
System.out.println("Would you like to return to home page?");
String home = s.nextLine();
if(!home.equalsIgnoreCase("yes"))
{
homepage = false;
}
break;
}
}
break;
}
case(2):
{
System.out.println("Welcome Receptionist.");
Receptionist.managesBooking();
break;
}
case(3):
{
System.out.println("Welcome Guest.");
break;
}
}
}
System.out.println("Would you like to return to log in page? ");
String response = s.nextLine();
while(!response.equalsIgnoreCase("yes") && !response.equalsIgnoreCase("no"))
{
System.out.println("Invalid input. Please enter 'yes' if you would like to return to log in page or 'no' if you would like to exit: ");
response = s.next();
}
if(response.equalsIgnoreCase("no"))
{
System.out.println("Goodbye " + Users.getCurrentUser().Name);
break;
}
}
}
}