master
1package ca.mokhan.comp268;
2
3import Q1.*;
4import Q10.*;
5import Q2.*;
6import Q3.*;
7import Q4.*;
8import Q5.*;
9import Q6.*;
10import Q7.*;
11import Q8.*;
12import Q9.*;
13import java.util.Scanner;
14
15public class App {
16 public static void main(String[] args) {
17 Scanner in = new Scanner(System.in);
18 Integer selection = args.length > 0 ? Integer.parseInt(args[0]) : null;
19
20 while (true) {
21 if (selection == null) {
22 System.out.println();
23 System.out.println("Choose exercise: (1-10)");
24 selection = in.nextInt();
25 }
26 switch (selection) {
27 case 1:
28 Q1.ReversedSentence.main(args);
29 break;
30 case 2:
31 Q2.RockPaperScissorsLizardSpock.main(args);
32 break;
33 case 3:
34 Q3.CreditCard.main(args);
35 break;
36 case 4:
37 Q4.RandomSumGame.main(args);
38 break;
39 case 5:
40 Q5.Village.main(args);
41 break;
42 case 6:
43 Q6.WeekDay.main(args);
44 break;
45 case 7:
46 Q7.Person.main(args);
47 break;
48 case 8:
49 Q8.BadmintonScoring.main(args);
50 break;
51 case 9:
52 Q9.MovingRobot.main(args);
53 break;
54 case 10:
55 Q10.TrainTimeTable.main(args);
56 break;
57 default:
58 System.out.println("Bye");
59 System.exit(0);
60 break;
61 }
62 selection = null;
63 }
64 }
65}