blob: 44920294809fa35cf4fe4ea49c9009f1a29c5c69 (
plain)
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
|
package ca.mokhan.comp268;
import Q1.*;
import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
Integer selection = args.length > 0 ? Integer.parseInt(args[0]) : null;
while (true) {
if (selection == null) {
System.out.println("Choose exercise: (1-10)");
selection = in.nextInt();
}
switch (selection) {
case 1:
Q1.ReversedSentence.main(args);
break;
case 2:
Q2.RockPaperScissorsLizardSpock.main(args);
break;
case 3:
Q3.CreditCard.main(args);
break;
case 4:
Q4.RandomSumGame.main(args);
break;
case 5:
Q5.Village.main(args);
break;
default:
System.out.println("Bye");
System.exit(0);
break;
}
selection = null;
}
}
}
|