Advertisement
Guest User

Untitled

a guest
Nov 18th, 2013
261
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. public class Peevish
  2. {
  3. public static void main(String[] args)
  4. {
  5. boolean[] door;
  6. final int NODOORS = 101; // We will not use door[0]
  7. final boolean OPEN = true;
  8. final boolean CLOSED = false;
  9. // Initialize the doors
  10. door = new boolean[NODOORS];
  11. for (int i = 0; i < NODOORS; i++)
  12. {
  13. door[i] = CLOSED;
  14. }
  15. // Print the state of each door (only doors 1-100)
  16. for (int i = 1; i < NODOORS; i++)
  17. {
  18. if (door[i] == true)
  19. {
  20. System.out.println("Door " + i + " is open.");
  21. }
  22. else
  23. {
  24. System.out.println("Door " + i + " is closed.");
  25. }
  26. }
  27. // My code here
  28.  
  29. for(int i = 1; i <= 100; i++)
  30. {
  31. for (int j = 1; j <= 100; j++)
  32. {
  33.  
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement