Advertisement
Guest User

MAIN TV

a guest
Mar 20th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.67 KB | None | 0 0
  1. public class Tester {
  2.  
  3.     public static void main(String[] args) {
  4.  
  5.  
  6.         Tv tv = new Tv("SAMSUNG", 2, false);
  7.         char c =0;
  8.         while (c!='E') {
  9.            
  10.             Scanner s = new Scanner(System.in);
  11.             System.out.println("choose e/x");
  12.             c = s.next().charAt(0);
  13.             switch (c) {
  14.             case 'X':
  15.             case 'x':
  16.                 System.out.println(tv.changeMuteStatuse());
  17.                 break;
  18.             case'E':
  19.                 System.out.println("exit");
  20.                 break;
  21.             default:
  22.                 try{
  23.                     System.out.println("enter volume");
  24.                     int v = s.nextInt();
  25.                     System.out.println(tv.chaneVolume(v));
  26.                
  27.                 }catch(Exception e){
  28.                     System.out.println(e.toString());
  29.                 }
  30.                
  31.                 break;
  32.             }
  33.            
  34.            
  35.         }
  36.     }
  37.  
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement