Repository navigation
Expand file tree
/
Copy pathMain.java
More file actions
43 lines (40 loc) · 1.51 KB
/
Copy pathMain.java
File metadata and controls
43 lines (40 loc) · 1.51 KB
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
package TaxiBookingSystem;
import java.util.Scanner;
import static TaxiBookingSystem.BookTaxi.bookingTaxi;
public class Main {
public static void main(String[] args) throws CloneNotSupportedException {
boolean loop = true;
while(loop){
System.out.println("Choose your option \n1.Book your Taxi \n2.Display Taxi details \n3.Exit \nEnter your choice:");
Scanner s = new Scanner(System.in);
int customer_choice = s.nextInt();
switch (customer_choice)
{
case 1:
{
System.out.println("Enter the pickup location:");
char pickupLocation = s.next().charAt(0);
System.out.println("Enter the drop location:");
char dropLocation = s.next().charAt(0);
System.out.println("Enter the pickup time:");
int pickupTime = s.nextInt();
System.out.println(BookTaxi.bookingTaxi(pickupLocation, dropLocation, pickupTime));
System.out.println("---------------------------------------");
break;
}
case 2:
{
BookTaxi.display();
break;
}
case 3:
{
loop = false;
System.out.println("Thank you!");
s.close();
break;
}
}
}
}
}