-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFipFirstproject.java
More file actions
428 lines (320 loc) · 9.24 KB
/
FipFirstproject.java
File metadata and controls
428 lines (320 loc) · 9.24 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
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
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
/*
FipsFirstProject by Umar Adamu
Date: 20-May-2017
A Program that takes a number and give the corresponding english name
*/
//Tring new stuff
//To import JOptionpane
import javax.swing.JOptionPane;
//Name of the program
public class FipFirstproject{
//Main method of the program
public static void main(String [] args){
//A Dialog box to prompt and collect a user input
String firstnumber = JOptionPane.showInputDialog("Enter a number from 1-100 and get a matched word");
int fn = Integer.parseInt(firstnumber);
//Switch statement that checks for valid cases
switch(fn){
case 1:
JOptionPane.showMessageDialog(null, "One");
break;
case 2:
JOptionPane.showMessageDialog(null, "Two");
break;
case 3:
JOptionPane.showMessageDialog(null, "Three");
break;
case 4:
JOptionPane.showMessageDialog(null, "Four");
break;
case 5:
JOptionPane.showMessageDialog(null, "Five");
break;
case 6:
JOptionPane.showMessageDialog(null, "Six");
break;
case 7:
JOptionPane.showMessageDialog(null, "Seven");
break;
case 8:
JOptionPane.showMessageDialog(null, "Eight");
break;
case 9:
JOptionPane.showMessageDialog(null, "Nine");
break;
case 10:
JOptionPane.showMessageDialog(null, "Ten");
break;
case 11:
JOptionPane.showMessageDialog(null, "Eleven");
break;
case 12:
JOptionPane.showMessageDialog(null, "Twelve");
break;
case 13:
JOptionPane.showMessageDialog(null, "Thirteen");
break;
case 14:
JOptionPane.showMessageDialog(null, "Fourtheen");
break;
case 15:
JOptionPane.showMessageDialog(null, "Fiftheen");
break;
case 16:
JOptionPane.showMessageDialog(null, "Sixtheen");
break;
case 17:
JOptionPane.showMessageDialog(null, "Seventheen");
break;
case 18:
JOptionPane.showMessageDialog(null, "Eightheen");
break;
case 19:
JOptionPane.showMessageDialog(null, "Ninetheen");
break;
case 20:
JOptionPane.showMessageDialog(null, "Twenty");
break;
case 21:
JOptionPane.showMessageDialog(null, "Twenty one");
break;
case 22:
JOptionPane.showMessageDialog(null, "Twenty Two");
break;
case 23:
JOptionPane.showMessageDialog(null, "Twenty three");
break;
case 24:
JOptionPane.showMessageDialog(null, "Twenty Four");
break;
case 25:
JOptionPane.showMessageDialog(null,"Twenty five");
break;
case 26:
JOptionPane.showMessageDialog(null, "Twenty six");
break;
case 27:
JOptionPane.showMessageDialog(null, "Twenty seven");
break;
case 28:
JOptionPane.showMessageDialog(null, "Twenty eigth");
break;
case 29:
JOptionPane.showMessageDialog(null, "Twenty nine");
break;
case 30:
JOptionPane.showMessageDialog(null, "Thirty");
break;
case 31:
JOptionPane.showMessageDialog(null, "Thirty one");
break;
case 32:
JOptionPane.showMessageDialog(null, "Thirty two");
break;
case 33:
JOptionPane.showMessageDialog(null, "Thirty three");
break;
case 34:
JOptionPane.showMessageDialog(null, "Thirty Four");
break;
case 35:
JOptionPane.showMessageDialog(null, "Thirty five");
break;
case 36:
JOptionPane.showMessageDialog(null, "Thirty six");
break;
case 37:
JOptionPane.showMessageDialog(null, "Thirty seven");
break;
case 38:
JOptionPane.showMessageDialog(null, "Thirty eight");
break;
case 39:
JOptionPane.showMessageDialog(null, "Thirty nine");
break;
case 40:
JOptionPane.showMessageDialog(null, "Fourthy");
break;
case 41:
JOptionPane.showMessageDialog(null, "Fourthy one");
break;
case 42:
JOptionPane.showMessageDialog(null, "Fourthy two");
break;
case 43:
JOptionPane.showMessageDialog(null, "Fourthy three");
break;
case 44:
JOptionPane.showMessageDialog(null, "Fourthy four");
break;
case 45:
JOptionPane.showMessageDialog(null, "Fourthy five");
break;
case 46:
JOptionPane.showMessageDialog(null, "Fourthy six");
break;
case 47:
JOptionPane.showMessageDialog(null, "Fourthy seven");
break;
case 48:
JOptionPane.showMessageDialog(null, "Fourthy eight");
break;
case 49:
JOptionPane.showMessageDialog(null, "Fourthy nine");
break;
case 50:
JOptionPane.showMessageDialog(null, "Fifthy");
break;
case 51:
JOptionPane.showMessageDialog(null, "Fifthy one");
break;
case 52:
JOptionPane.showMessageDialog(null, "Fifthy Two");
break;
case 53:
JOptionPane.showMessageDialog(null, "Fifthy Three");
break;
case 54:
JOptionPane.showMessageDialog(null, "Fifthy Four");
break;
case 55:
JOptionPane.showMessageDialog(null, "Fifthy Five");
break;
case 56:
JOptionPane.showMessageDialog(null, "Fifthy Six");
break;
case 57:
JOptionPane.showMessageDialog(null, "Fifthy Seven");
break;
case 58:
JOptionPane.showMessageDialog(null, "Fifthy Eight");
break;
case 59:
JOptionPane.showMessageDialog(null, "Fifthy Nine");
break;
case 60:
JOptionPane.showMessageDialog(null, "Sixty");
break;
case 61:
JOptionPane.showMessageDialog(null, "Sixthy one");
break;
case 62:
JOptionPane.showMessageDialog(null, "Sixthy two");
break;
case 63:
JOptionPane.showMessageDialog(null, "Sixthy three");
break;
case 64:
JOptionPane.showMessageDialog(null, "Sixthy four");
break;
case 65:
JOptionPane.showMessageDialog(null, "Sixthy five");
break;
case 66:
JOptionPane.showMessageDialog(null, "Sixthy six");
break;
case 67:
JOptionPane.showMessageDialog(null, "Sixthy seven");
break;
case 68:
JOptionPane.showMessageDialog(null, "Sixthy Eight");
break;
case 69:
JOptionPane.showMessageDialog(null, "Sixthy Nine");
break;
case 70:
JOptionPane.showMessageDialog(null, "Seventy");
break;
case 71:
JOptionPane.showMessageDialog(null, "Seventy one");
break;
case 72:
JOptionPane.showMessageDialog(null, "Seventy Two");
break;
case 73:
JOptionPane.showMessageDialog(null, "Seventy three");
break;
case 74:
JOptionPane.showMessageDialog(null, "Seventy Four");
break;
case 75:
JOptionPane.showMessageDialog(null, "Seventy five");
break;
case 76:
JOptionPane.showMessageDialog(null, "Seventy six");
break;
case 77:
JOptionPane.showMessageDialog(null, "Seventy seven");
break;
case 78:
JOptionPane.showMessageDialog(null, "Seventy eigth");
break;
case 79:
JOptionPane.showMessageDialog(null, "Seventy nine");
break;
case 80:
JOptionPane.showMessageDialog(null, "Eighty");
break;
case 81:
JOptionPane.showMessageDialog(null, "Eighty one");
break;
case 82:
JOptionPane.showMessageDialog(null, "Eighty two");
break;
case 83:
JOptionPane.showMessageDialog(null, "Eighty three");
break;
case 84:
JOptionPane.showMessageDialog(null, "Eighty Four");
break;
case 85:
JOptionPane.showMessageDialog(null, "Eighty five");
break;
case 86:
JOptionPane.showMessageDialog(null,"Eighty six");
break;
case 87:
JOptionPane.showMessageDialog(null, "Eighty seven");
break;
case 88:
JOptionPane.showMessageDialog(null, "Eighty eight");
break;
case 89:
JOptionPane.showMessageDialog(null, "Eighty nine");
break;
case 90:
JOptionPane.showMessageDialog(null, "Ninety");
break;
case 91:
JOptionPane.showMessageDialog(null, "Ninety one");
break;
case 92:
JOptionPane.showMessageDialog(null, "Ninety two");
break;
case 93:
JOptionPane.showMessageDialog(null, "Ninety three");
break;
case 94:
JOptionPane.showMessageDialog(null, "Ninety four");
break;
case 95:
JOptionPane.showMessageDialog(null, "Ninety five");
break;
case 96:
JOptionPane.showMessageDialog(null, "Ninety six");
break;
case 97:
JOptionPane.showMessageDialog(null, "Ninety seven");
break;
case 98:
JOptionPane.showMessageDialog(null, "Ninety eight");
break;
case 99:
JOptionPane.showMessageDialog(null, "Ninety nine");
break;
case 100:
JOptionPane.showMessageDialog(null, "One Hundred");
break;
}
}
}