-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLicenceStatus.java
More file actions
148 lines (128 loc) · 6.48 KB
/
LicenceStatus.java
File metadata and controls
148 lines (128 loc) · 6.48 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
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
public class LicenceStatus {
public static boolean licencereview= false;
public static int licencecategory, userid, license_number;
public static Userdetail userdetailobj= new Userdetail();
public static void rules_of_traffic(){
System.out.println("""
Speed Limits
Kathmandu Valley: The speed limit is set at 50 km/h.
Common Traffic Violations and Fines
The Motor Vehicles and Transport Management Act of 1993 outlines various offenses and their penalties:
**Rs. 500 Fine:
Not wearing a helmet on motorcycles or seat belts in four-wheelers.
Carrying passengers on the roof of vehicles.
Overloading beyond vehicle capacity.
Using vehicles beyond the permitted use.
Reckless driving endangering others.
Obstructing the road.
**Rs. 1,000 Fine:
Driving under the influence of alcohol.
Unauthorized parking in public places.
Driving without a license or allowing an unlicensed person to drive.
Involvement in accidents or fleeing the scene.
**Rs. 1,500 Fine:
Disobeying traffic signs.
Wrong lane driving.
Operating public vehicles without a route permit.
Overcharging passengers.
Over speeding.
Driving in prohibited areas.
Driving without headlights at night.
Refusing to pick up passengers in public transport.
""");
System.out.println("Are you agree with that?");
String useragree= Registration.scannerobject.next();
useragree= useragree.toLowerCase();
switch (useragree){
case "yes":
System.out.println("Congs,"+userdetailobj.getName()+" for your licence approval."+Registration.emoji[4]);
userid= (int) ((Math.random()*90000)+10000);
System.out.println("Your user ID is: "+userid);
licencereview= true;
break;
case "no":
System.out.println(Registration.emoji[3]+" Sry doesn't approved.");
break;
}
}
public static void chossing_number_case1(){
System.out.println("""
What do you want to do?
1. Login
2. SignUp""");
int userstatus= Registration.scannerobject.nextInt();
switch (userstatus){
case 1:
System.out.println("Enter the citizenship Number:");
long userenteredcitizenshipnumber= Registration.scannerobject.nextLong();
System.out.println("Enter password:");
String userenteredpassword= Registration.scannerobject.next();
if (userenteredcitizenshipnumber==userdetailobj.getCitizenship_number() && userenteredpassword.equals(userdetailobj.getPassword())){
System.out.println("Hence, Successfully Login.");
}
else {
System.out.println("**The detail you provided is wrong. plz Try again.**");
}
break;
case 2:
userdetailobj.Userdetail(LicenceStatus.userdetailobj.getName(), LicenceStatus.userdetailobj.getAddress(),LicenceStatus.userdetailobj.getPhonenumber(), LicenceStatus.userdetailobj.getCitizenship_number(), LicenceStatus.userdetailobj.getPassword() );
userdetailobj.User_status_case2_loop_for_password();
break;
}
}
public static void chossing_number_case2(){
System.out.println("""
****License Application****
Choose from below menu:
1. Apply for new licence.
2. View avaliable licence.""");
int userlicence= Registration.scannerobject.nextInt();
switch (userlicence){
case 1:
System.out.println("""
For which category, You want to apply?
1. Motorcycle
2. Car
3. Bus
""");
licencecategory= Registration.scannerobject.nextInt();
if (licencecategory<=3 && licencecategory>=1){
LicenceApplication.file_upload_for_licence();
}
switch (licencecategory){
case 1:
Registration.required_age= 16;
Registration.small_vechicles="Bicycle";
Registration.nexteligibility= "Car";
LicenceApplication.requirement_for_licence();
Registration.task_one_completed= true;
break;
case 2:
Registration.required_age= 18;
Registration.small_vechicles= "Motorcycle";
Registration.nexteligibility= "Bus";
LicenceApplication.requirement_for_licence();
Registration.task_two_completed= true;
break;
case 3:
Registration.required_age= 18;
Registration.small_vechicles= "Motorcycle";
Registration.nexteligibility= "Bus";
LicenceApplication.requirement_for_licence();
Registration.task_three_completed= true;
break;
}
System.out.println("Enter the license number:");
license_number= Registration.scannerobject.nextInt();
break;
case 2:
if (userid>0) {
System.out.println("Category: "+licencecategory);
System.out.println("Licence ID: "+userid);
} else {
System.out.println("Your licence category is empty.");
}
break;
}
}
}