document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. import java.util.Scanner;
  2. public class IntMain
  3. {
  4.     // instance variables - replace the example below with your own
  5.    
  6.  
  7.     /**
  8.      * Constructor for objects of class IntMain
  9.      */
  10.     public static void main(String args[])
  11.     {
  12.         // initialise instance variables
  13.         Scanner scan=new Scanner(System.in);
  14.         int cost, menu;
  15.         System.out.println("Masukkan harga tiket \\n");
  16.         cost=scan.nextInt();
  17.         TicketMachine ticket=new TicketMachine(cost);
  18.         System.out.println("1. Get Price");
  19.         System.out.println("2. Get Balance");
  20.         System.out.println("3. Insert Money");
  21.         System.out.println("4. Print Ticket");
  22.         menu=scan.nextInt();
  23.         switch(menu){
  24.             case 1:
  25.             cost=ticket.getPrice();
  26.             System.out.println(cost);
  27.             break;
  28.             case 2:
  29.             ticket.getBalance();
  30.             break;
  31.             case 3:
  32.             int money=scan.nextInt();
  33.             ticket.insertMoney(money);
  34.             break;
  35.             case 4:
  36.             ticket.printTicket();
  37.             break;
  38.         }
  39.        
  40.     }
  41. }
');