Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Peevish
- {
- public static void main(String[] args)
- {
- boolean[] door;
- final int NODOORS = 101; // We will not use door[0]
- final boolean OPEN = true;
- final boolean CLOSED = false;
- // Initialize the doors
- door = new boolean[NODOORS];
- for (int i = 0; i < NODOORS; i++)
- {
- door[i] = CLOSED;
- }
- // Print the state of each door (only doors 1-100)
- for (int i = 1; i < NODOORS; i++)
- {
- if (door[i] == true)
- {
- System.out.println("Door " + i + " is open.");
- }
- else
- {
- System.out.println("Door " + i + " is closed.");
- }
- }
- // My code here
- for(int i = 1; i <= 100; i++)
- {
- for (int j = 1; j <= 100; j++)
- {
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement