This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ProPara.java
202 lines (188 loc) · 9.17 KB
/
ProPara.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
*/
package com.mycompany.propara;
import java.util.*;
/**
*
* @author Uzziah_Lukeka
*/
public class ProPara {
public static void main(String[] args) {
System.out.println("WELCOME TO OUR CINEMA , HERE DOWN FIND THE MOVIES");
String[] movie = {"Naruto", "One piece red", "Kuroko's basket", "my hero academia"};
List<Movies> movi;
movi = new ArrayList<>();
for (String movie1 : movie) {
Movies z = new Movies();
z.setmovie(movie1);
movi.add(z);
}
for (Movies u : movi) {
System.out.println(u.getmovie());
}
System.out.println("1 to 4 according to the presentation");
System.out.println("SELECT YOUR MOVIE : ");
Scanner uzh = new Scanner(System.in);
int Mov = 0;
boolean yth = true;
while (yth) {
try {
do {
Mov = uzh.nextInt();
switch (Mov) {
case 1 -> System.out.println("you choose Naruto");
case 3 -> System.out.println("you choose Kuroko's basket");
case 4 -> System.out.println("you choose My hero academia");
case 2 -> System.out.println("you choose One piece red");
//default -> System.out.println("\033[31mSorry you type wrongly , please choose one of the movies up there and type the same name\033[0m");
}
if (Mov < 1 || Mov > 4) {
System.out.println(" please type correctly the number (from 1 to 4) ");
}
yth = false;
} while (Mov < 1 || Mov > 4);
} catch (InputMismatchException e) {
System.out.print(" type a number according to the presentation : ");
uzh.next();
}
}
int number;
Scanner lkk = new Scanner(System.in);
System.out.println("Do you want to continue ? (press 1 for yes and 0 for no) : ");
boolean bowa=true;
while(bowa){
try {
number = lkk.nextInt();
if (number == 1) {
System.out.println("""
we have 3 kind of rooms we have VIP : we give you food , drink , table and you can choose you seat and it costs 150 pln
we have Normal :we offert you drink , a table and you can choose your seat and it costs 100 pln
our last option is Discount room : we don't offert you anything it costs 50""");
System.out.println(" Choose 1 for VIP "
+ "2 for Normal "
+ "3 for discount");
Vip vip = new Vip();
Normal normal = new Normal();
MovieRoom discount = new MovieRoom();
Scanner choice = new Scanner(System.in);
int choix;
choix = 0;
//String color = "Blue";
int chaise;
boolean stop = true;
while (stop) {
try {
choix = choice.nextInt();
Scanner choisir = new Scanner(System.in);
boolean moi=true;
switch (choix) {
case 1 -> {
System.out.println("WELCOME TO OUR VIP ROOM!!");
vip.drinks();
vip.foods();
System.out.println("""
Do you know where is your table ?
press 1 for YES and 0 for NO""");
while(moi){
chaise = choisir.nextInt();
switch (chaise) {
case 0:
vip.whereismytable();
case 1:
System.out.println("Thank you for your confirmation!");
//default : System.out.println("Please choose 1 or 0 ");
moi=false;
}
if (chaise < 0 || chaise > 1) {
System.out.println("Please choose 1 or 0 ");
}
}
}
case 2 -> {
System.out.println("""
WELCOME TO OUR NORMAL ROOM
We offert possibility to choose one drink among
redbull , fanta and ice tea ___PLEASE TYPE YOUR DRINK___""");
Scanner boiss = new Scanner(System.in);
String boire;
boire = boiss.nextLine();
normal.drinks(boire);
normal.foods();
System.out.println("""
Do you know where is your table ?
press 1 for YES and 0 for NO""");
while(moi) {
chaise = choisir.nextInt();
switch (chaise) {
case 1:
System.out.println("Thank you for your confirmation!");
case 0:
normal.whereismytable();
moi=false;
}
if (chaise < 0 || chaise > 1) {
System.out.println("Please choose 1 or 0 ");
}
}
}
case 3 -> {
System.out.println("WELCOME TO OUR DISCOUNT ROOM");
discount.seat();
discount.foods();
discount.buydrink();
}
}
stop = false;
} catch (InputMismatchException i) {
System.out.println("Please type number 1-3");
choice.next();
}
}
System.out.println("Do you want to continue Y / N ?");
//Scanner oui = new Scanner(System.in);
Scanner ji = new Scanner(System.in);
char lol;
boolean ath = true;
while (ath) {
lol = ji.next().charAt(0);
if (lol == 'Y' || lol == 'y') {
Human per = new Human();
Scanner nom = new Scanner(System.in);
Scanner surnom = new Scanner(System.in);
System.out.println("Write your name");
String djina = nom.nextLine();
per.setname(djina);
System.out.println("Write your surname");
String nani = surnom.nextLine();
per.setsurname(nani);
System.out.println("WELCOME " + per.yourfullname());
System.out.println("""
please remember type room: 1. VIP=150pln 2. Normal=100pln 3.Discount=50 pln
Welcome,""" + per.yourfullname() + " you choose " + choix + " as your room Thank you for you choix");
System.out.println("Your ticket is for : ");
System.out.println(movi.get(Mov - 1).getmovie() + " type room : " + choix + " person's name " + per.yourname());
System.out.println("WELCOME AND HAVE FUN !!!");
ath = false;
} else if (lol == 'N' || lol == 'n') {
System.out.println("THANK YOU we hope to see you again !!");
ath = false;
} else {
System.out.println("Please type Y or N");
}
// yth = false;
}
bowa=false;
} else if (number == 0) {
System.out.println("THANK YOU !! We hope to see you again soon");
bowa=false;
} else {
System.out.println("you type a character different of what presented to you Please choose 1 to CONTINUE and 0 to END ");
}
} catch (InputMismatchException e){
System.out.println("please choose 1 to continue and 0 to end");
lkk.next();
}
}
}
}