Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DoubleLift{
- private boolean[][] Floors;
- public DoubleLift(){
- Floors = new boolean[2][5];
- }
- public void change(int x){
- Floors[0][x] = true;
- Floors[1][x] = true;
- }
- public static void main (String[]args){
- Scanner inBox = new Scanner(System.in);
- DoubleLift n = new DoubleLift();
- System.out.println("floor please");
- int floor = inBox.nextInt();
- n.change(floor);
- for(int t=0; t< n.Floors[1].length; t++){
- System.out.print(n.Floors[0][t]);
- System.out.print(n.Floors[1][t]);
- System.out.println("");
- }
- }
- }
Add Comment
Please, Sign In to add comment