-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMain.java
129 lines (105 loc) · 5.4 KB
/
Main.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import java.util.Scanner;
interface utility{
public void getDetails();
public void setDetails();
}
public class Main {
public static void menu(){
System.out.println(":>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Kindly choose a choice acc to your Service <<<<<<<<<<<<<<<<<<<<<<<<<<<<<:");
System.out.println("""
1) Add the showroom 2) Add the car 3) Add the Employee
4) Get Showroom Details 5) Get Car Details 6) Get Employee Details
9) Go to Menu 0) Exit
""");
System.out.println("Enter your choice Please :>>>>");
}
public static void main(String[] args) {
Showroom showroom[] = new Showroom[10];
Car car[] = new Car[10];
Employee employee[] = new Employee[10];
int showroom_ind = 0;
int car_ind = 0;
int empl_ind = 0;
int choice = 50;
System.out.println(":>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Welcome to Our Showroom <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<: ");
while(choice!=0){
Scanner s = new Scanner(System.in);
menu();
choice = s.nextInt();
while (choice!=0 && choice!=9){
System.out.println();
if(choice==1){
System.out.println("Processing your request :- Adding the Showroom ");
showroom[showroom_ind] = new Showroom();
showroom[showroom_ind].setDetails();
showroom_ind++;
System.out.println("Do you wish to continue to Add Showroom :- 1) Yes 9) Go to Menu 0) Exit");
choice = s.nextInt();
System.out.println();
System.out.println("Processing......................");
}
else if(choice == 2){
System.out.println("Processing your request :- Adding the Car ");
car[car_ind] = new Car();
car[car_ind].setDetails();
car_ind++;
System.out.println("Do you wish to continue to Add Car :- 1) Yes 9)Go to Menu 0) Exit ");
choice = s.nextInt();
if(choice==1) choice = 2;
System.out.println();
System.out.println("Processing......................");
}
else if(choice == 3){
System.out.println("Processing your request :- Adding the Employee ");
employee[empl_ind] = new Employee();
employee[empl_ind].setDetails();
empl_ind++;
System.out.println("Do you wish to continue to Add Employee :- 1) Yes 9) Go to Menu 0) Exit ");
choice = s.nextInt();
if(choice==1) choice = 3;
System.out.println();
System.out.println("Processing......................");
}
else if(choice == 4){
System.out.println("Processing your request :- Getting Details of Showroom ");
for(int i = 0;i<showroom_ind;i++){
showroom[i].getDetails();
}
System.out.println("Do you wish to continue to Get Details :- 1) Yes 9) Go to Menu 0) Exit ");
choice = s.nextInt();
if(choice==1) choice = 4;
System.out.println();
System.out.println("Processing......................");
}
else if(choice == 5){
System.out.println("Processing your request :- Getting Details of Car ");
for(int i = 0;i<car_ind;i++){
car[i].getDetails();
}
System.out.println("Do you wish to continue to Get Details :- 1) Yes 9) Go to Menu 0) Exit ");
choice = s.nextInt();
if(choice==1) choice = 5;
System.out.println();
System.out.println("Processing......................");
}
else if(choice == 6){
System.out.println("Processing your request :- Getting Details of Employee ");
for(int i = 0;i<empl_ind;i++){
employee[i].getDetails();
}
System.out.println("Do you wish to continue to Get Details :- 1) Yes 9) Go to Menu 0) Exit ");
choice = s.nextInt();
if(choice==1) choice = 6;
System.out.println();
System.out.println("Processing......................");
}
else{
System.out.println("Kindly make a choice from the menu -> 0) Exit 9) Go to Menu 0) Exit ");
choice = s.nextInt();
System.out.println();
System.out.println("Processing......................");
}
}
}
}
}