Guest User

Untitled

a guest
Jan 16th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class DoubleLift{
  3.  
  4. private boolean[][] Floors;
  5.  
  6. public DoubleLift(){
  7. Floors = new boolean[2][5];
  8. }
  9. public void change(int x){
  10. Floors[0][x] = true;
  11. Floors[1][x] = true;
  12. }
  13.  
  14. public static void main (String[]args){
  15. Scanner inBox = new Scanner(System.in);
  16.  
  17. DoubleLift n = new DoubleLift();
  18.  
  19. System.out.println("floor please");
  20. int floor = inBox.nextInt();
  21.  
  22. n.change(floor);
  23.  
  24. for(int t=0; t< n.Floors[1].length; t++){
  25. System.out.print(n.Floors[0][t]);
  26. System.out.print(n.Floors[1][t]);
  27. System.out.println("");
  28.  
  29. }
  30. }
  31. }
Add Comment
Please, Sign In to add comment