/*THIS PROGRAM PROMPTS THE USE TO INPUT ROOM NUMBERS AND THE FIRST INPUTTED NUMBER WILL BE "OCCUPIED" , AND IF THE ROOM NUMBER(IN THE FIRST INPUT) IS INPUTTED AGAIN AT THE SECOND INPUT IT WILL SAY THAT IT IS "NOT AVAILABLE" . . */
//Here is my code :
import java.io.*;
public class Room {
public static void main(String[] args)throws IOException {
int[] arr = new int[5];
int input, i = 0;
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
do {
System.out.print("Enter Room Number: ");
input = Integer.parseInt(in.readLine());
arr[i] = input;
if(arr[i] == input) {
System.out.println("Reserved");
}
else {
System.out.print("Occupied, Not Available");
}
}while(input != -1);
}
}