keymasterviriya1150

Untitled

Feb 11th, 2016
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.96 KB | None | 0 0
  1. // Microwave
  2. /*By อามมมมมมมมี่ ภาคสองเพิ่มแบนวิช
  3.   facebook:codegeassmasterzeronebreakout
  4.   At banlnw*/
  5.  
  6. import java.util.Scanner;
  7.  
  8. class Main
  9. {
  10.     public static void main(String[] args)
  11.     {
  12.        
  13.         Microwave m=new Microwave();
  14.         p("Status:OFF,Microwave\n");
  15.         try{
  16.             m.inputConnect();
  17.         }catch(Exception e)
  18.         {
  19.            p("Error :There is something wrong\n");
  20.         }
  21.     }
  22.      static void p(String input)
  23.     {
  24.         System.out.print(input);
  25.     }
  26.    
  27. }
  28. class Microwave
  29. {
  30.     static  Scanner s=new Scanner(System.in);
  31.     Byte Connect;
  32.     String Bringfood;
  33.     int  sec;
  34.     int     watt;
  35.     void inputConnect() throws InterruptedException
  36.     {
  37.         p("Switches \n"
  38.                 + "1.On \n"
  39.                 + "2.Off\n"
  40.                 + "Choose Menu :");
  41.        
  42.         Connect=s.nextByte();
  43.         if(Connect==1)
  44.         {
  45.             p("DETAIL: Microwave SHARP 22 liter ver. R-220 while\n");
  46.             p(":=========Open,Microwave=========:\n");
  47.             inputBringfood();
  48.             inputtime();
  49.             inputspectrum();
  50.             p("Microwave Working Pls Wait.....\n");
  51.             Thread.sleep(200*gettime());
  52.             p("Success\n");
  53.             p(":=========Close,Microwave=========:\n");
  54.            
  55.         }
  56.         else{
  57.             p("Microwave oven was off to do so\n");
  58.         }
  59.     }
  60.     void inputBringfood()
  61.     {
  62.        p("Input food  in Microwave :");
  63.         Bringfood=s.next();
  64.         p("\n");
  65.     }
  66.     void inputtime()
  67.     {
  68.         p("Set Time Second :");
  69.         sec=s.nextInt();
  70.         p("\n");
  71.     }
  72.     int gettime()
  73.     {
  74.         return sec;
  75.     }
  76.     void inputspectrum()
  77.     {
  78.         p("Set Spectrum  watt:");
  79.         watt=s.nextInt();
  80.         p("\n");
  81.     }
  82.    
  83.     static void p(String input)
  84.     {
  85.         System.out.print(input);
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment