Advertisement
DigiDuncan

MLApp

Jun 29th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class MLApp
  4. {
  5.     public static void main (String [] args)
  6.     {
  7.         Scanner input = new Scanner(System.in);
  8.         MLServer server = new MLServer();
  9.        
  10.         int choice = 0;
  11.         String menuchoice = "";
  12.        
  13.         String menu = "";
  14.         menu += "1) A Sailing Trip\n";
  15.        
  16.         System.out.println("Welcome to MadLibber!");
  17.         System.out.println("Type (m) for story menu, (s) for a story, or (x) to exit.");
  18.         System.out.print(">");
  19.        
  20.         menuchoice = input.nextLine();
  21.        
  22.         switch (menuchoice)
  23.         {
  24.         case "m":
  25.             System.out.println(menu);
  26.         case "s":
  27.             System.out.println("Choose a story!");
  28.             System.out.print(">");
  29.             choice = input.nextInt();
  30.             server.chooseStory(choice);
  31.             break;
  32.         case "x":
  33.             System.exit(0);
  34.             break;
  35.         }
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement