forked from Adityaranjanpatra/Btecky2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CAB BOOKING SYSTEM IN JAVA
93 lines (91 loc) · 2.79 KB
/
CAB BOOKING SYSTEM IN 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
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
System.out.println("***********************************");
System.out.println(" JAY SHREE RAM CABS");
System.out.println("***********************************");
System.out.println("Enter Your name=");
String name=sc.next();
System.out.println("Enter Contact number=");
int no= sc.nextInt();
int count=0;
int rem;
int time=0,km=0;
String dp,pp;
System.out.println("Enter number:");
no= sc.nextInt();
do {
System.out.println("Enter number:");
no = sc.nextInt();
while (no > 0) {
rem = no % 10;
count++;
no = no / 10;
}
}while (count!=10);
System.out.println("Enter Pickup Point=");
pp=sc.next();
System.out.println("Enter Droping Point=");
dp=sc.next();
System.out.println("Enter Kilo meters=");
km=sc.nextInt();
System.out.println("Enter Time =");
time=sc.nextInt();
System.out.println("Choose Vehicle= \n 1. Two-Wheeler OLA \n 2.SUV 700 \n 3. Maruti suzuki \n 4. Auto \n 5.M G Hector");
int ch=sc.nextInt();
switch(ch){
case 1:
if (time<12) {
System.out.println("Total price for your trip =" + (km * 10));
}
else {
System.out.println("Total price for your trip =" + (km * 15));
}
break;
case 2:
if (time<12) {
System.out.println("Total price for your trip =" +(km * 20));
}
else
{
System.out.println("Total price for your trip ="+(km*25));
}
break;
case 3:
if (time<12) {
System.out.println("Total price for your trip =" + (km * 30));
}
else
{
System.out.println("Total price for your trip ="+(km*35));
}
break;
case 4:
if (time<12) {
System.out.println("Total price for your trip =" + (km * 25));
}
else {
System.out.println("Total price for your trip ="+(km*30));
}
break;
case 5:
if (time<12)
{
System.out.println("Total price for your trip ="+(km*50));
}
else {
System.out.println("Total price for your trip ="+(km*70));
}
}
System.out.println("Want to Confirm Your Order = \n 1. Yes \n 2. No");
int ans=sc.nextInt();
if(ans==1)
{
System.out.println("Your order is confirmed. \n Enjoy the Trip ☻");
}
else {
System.out.println("Thank for Giving Your Time \n Let Meet You Soon ☻");
}
}
}