summaryrefslogtreecommitdiff
path: root/src/App.java
blob: 61701874d7c07fe1ca3456a8ad6b3a5b2fab51b0 (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
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;
        default:
          System.out.println("Bye");
          System.exit(0);
          break;
      }
      selection = null;
    }
  }
}