-
Notifications
You must be signed in to change notification settings - Fork 0
/
rana.java
282 lines (239 loc) · 8.82 KB
/
rana.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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
// package FoodPandaaExd;
import java.io.*;
import java.sql.SQLOutput;
import java.util.Scanner;
public class rana extends mohid {
public static Scanner input = new Scanner(System.in);
public static String[][] ipAddress = {
{ "Sector", "G-10" },
{ "Soup Restaurant", "123.456.001" },
{ "Pizza Restaurant", "123.456.002" },
{ "Desi Restaurant", "123.456.003" },
{ " ", "123.456.004" },
{ " ", "123.456.005" },
{ " ", "123.456.006" },
{ " ", "123.456.007" },
// For House in Sectors
{ "House No 1", "Street 1", "321.654.001" },
{ "House No 2", "Street 1", "321.654.002" },
{ "House No 3", "Street 1", "321.654.003" },
{ "House No 4", "Street 1", "321.654.004" },
{ "House No 5", "Street 1", "321.654.005" },
// Street 2:
{ "House No 1", "Street 2", "321.654.006" },
{ "House No 2", "Street 2", "321.654.007" },
{ "House No 3", "Street 2", "321.654.008" },
{ "House No 4", "Street 2", "321.654.009" },
{ "House No 5", "Street 2", "321.654.010" },
// Street 3:
{ "House No 1", "Street 3", "321.654.011" },
{ "House No 2", "Street 3", "321.654.012" },
{ "House No 3", "Street 3", "321.654.013" },
{ "House No 4", "Street 3", "321.654.014" },
{ "House No 5", "Street 3", "321.654.015" },
// Street 4:
{ "House No 1", "Street 4", "321.654.016" },
{ "House No 2", "Street 4", "321.654.017" },
{ "House No 3", "Street 4", "321.654.018" },
{ "House No 4", "Street 4", "321.654.019" },
{ "House No 5", "Street 4", "321.654.020" },
// Street 5:
{ "House No 1", "Street 5", "321.654.021" },
{ "House No 2", "Street 5", "321.654.022" },
{ "House No 3", "Street 5", "321.654.023" },
{ "House No 4", "Street 5", "321.654.024" },
{ "House No 5", "Street 5", "321.654.025" }
};
public static void main(String[] args) {
/*
* String[][] food = my_Ip();
* System.out.println("Enter your house no like (House No 1)");
* String user = input.nextLine();
* System.out.println("Enter your street no like (Street 1)");
* String user2 = input.nextLine();
* String ip = "";
* String ipRes = "";
*
* for(int row = 0; row < 8; row++) {
* if(user.equalsIgnoreCase(food[row][1])){
* ipRes += food[row][2];
* }
* }
* System.out.println(ipRes);
* //user.equalsIgnoreCase();
* for (int row1 = 8; row1 < food.length; row1++) {
* if(user.equalsIgnoreCase(food[row1][0]) &&
* user2.equalsIgnoreCase(food[row1][1])){
* ip += food[row1][2];
* }
* }
*/
// System.out.println(my_Ip());
// System.out.println(ipLocationRes());
// String a= ipLocationRes("abc");
// System.out.println(a);
}
// Defining IPs Address of Different Restorounts in The Sector
// Access it Through Index or File Handling
// Feedbackk>>>>>>>>>>
public static void myFed() throws Exception {
Scanner input = new Scanner(System.in);
System.out.print("Please give your Valuable Feedback\n" +
"Thank You For Buying \n" +
"Please Enter Name First \n");
String name = input.nextLine();
System.out.println("Enter The Name of Resturant You Want to give Feedback...");
String res = input.nextLine();
System.out.println("What would you like to say about the Resstaraunt: ");
String fed = input.nextLine();
System.out.println("Your feed back has been Forwarded. Thank You...");
try {
File xyz = new File("feedback.txt");
FileWriter fileWriter = new FileWriter("feedback.txt", true);
fileWriter.write("Name: " + name + "\n");
fileWriter.write("Restaraunt Name: " + res + "\n");
fileWriter.write("FeedBack given: " + fed);
fileWriter.write("\n");
fileWriter.close();
} catch (Exception e) {
System.out.println(e.getStackTrace());
}
}
public static String ipLocationHouse() {
// String[][] ipAddress = {
// {"Sector", "G-10"},
// {"Soup Restaurant", "123.456.001"},
// {"Pizza Restaurant", "123.456.002"},
// {"Desi Restaurant", "123.456.003"},
// {"", "123.456.004"},
// {"", "123.456.005"},
// {"", "123.456.006"},
// {"", "123.456.007"},
// // For House in Sectors
// {"House No 1", "Street 1", "321.654.001"},
// {"House No 2","Street 1", "321.654.002"},
// {"House No 3","Street 1", "321.654.003"},
// {"House No 4","Street 1", "321.654.004"},
// {"House No 5", "Street 1", "321.654.005"},
// // Street 2:
// {"House No 1","Street 2","321.654.006"},
// {"House No 2","Street 2","321.654.007"},
// {"House No 3","Street 2","321.654.008"},
// {"House No 4","Street 2", "321.654.009"},
// {"House No 5","Street 2","321.654.010"},
// // Street 3:
// {"House No 1","Street 3","321.654.011"},
// {"House No 2","Street 3","321.654.012"},
// {"House No 3","Street 3","321.654.013"},
// {"House No 4","Street 3","321.654.014"},
// {"House No 5","Street 3","321.654.015"},
// // Street 4:
// {"House No 1","Street 4","321.654.016"},
// {"House No 2","Street 4","321.654.017"},
// {"House No 3","Street 4","321.654.018"},
// {"House No 4","Street 4","321.654.019"},
// {"House No 5","Street 4","321.654.020"},
// // Street 5:
// {"House No 1","Street 5","321.654.021"},
// {"House No 2","Street 5","321.654.022"},
// {"House No 3","Street 5","321.654.023"},
// {"House No 4","Street 5","321.654.024"},
// {"House No 5","Street 5","321.654.025"}
// };
while (true) {
System.out.println("Enter your house no like (House No 1)");
String user = input.nextLine();
System.out.println("Enter your street no like (Street 1)");
String user2 = input.nextLine();
String ip = "";
boolean isFound = false;
for (int row1 = 8; row1 < ipAddress.length; row1++) {
if (user.equalsIgnoreCase(ipAddress[row1][0]) && user2.equalsIgnoreCase(ipAddress[row1][1])) {
ip += ipAddress[row1][2];
return ip;
}
}
if (isFound == false) {
System.out.println("Invalid House and Street No.");
}
}
// System.out.println(ip);
}
public static String ipLocationRes(String user) throws Exception {
// boolean isEmpty = false;
String ip = "";
int temp1 = mohid.get_lines("restauraunt_login_data.txt") / 4;
ipAddress[temp1 + 1][0] = user;
return ipAddress[temp1 + 1][1];
// for (int row1 = 1; row1 < 8; row1++) {
// // System.out.println(ipAddress[row1][0]);
// // if(ipAddress[row1][0].equals(" ")){
// // temp1 = row1;
// // System.out.println(temp1);
// // ipAddress[temp1][0]= user;
// // break;
// // }
// // }
// return ipAddress[temp1][1];
}
}
/*
*
*
*
* static void callMe(String[][] arr) {
* //For Displaying Matrix
*
* for (int row = 0; row < arr.length; row++) {
* // System.out.println("Element at index " + i + " = " + arr[i]);
* for (int col = 0; col < arr[row].length; col++)
* System.out.printf("%-30s", arr[row][col] + " ");
*
* System.out.println();
*
* }
*
* }
* //FeedBack Module Final Step...
*
* static void feedBack(){
* Scanner input = new Scanner(System.in);
*
* System.out.print(">>>>>>>>>>>>>Give Your FeedBack<<<<<<<<<<<<<<<\n" +
* "Thank You For Buying ***Happy Meal\n" +
* "Please Give Us You Kind Feedback Here: \n");
*
* String fed= input.nextLine();
* System.out.println("Thank You...");
*
*
*
* }
*
* // Module For Cancelation of Any Order:
* public static int cancel(int var){
* Scanner input = new Scanner(System.in);
* String a1= " Want To Cancel Any Order?>>> Press 1 \n" +
* " Or Want to Confirm? >>> Press 2 ";
*
* System.out.println(a1);
* String var1 = input.next();
* if(var1.equals("1")) {
* System.out.println("Enter Name or ID of Your Order Here");
*
* System.out.println(input.next());
* var=-1;
*
* }
*
* else if(a1.equals("2")){
*
* System.out.println("We are Confirming Your Order...ASAP");
* System.exit(Integer.parseInt(a1));
*
* }
*
*
* return var;
* }
*/