https://proficientwriters.net/wp-content/uploads/2020/04/logo-300x60.png 0 0 Paul https://proficientwriters.net/wp-content/uploads/2020/04/logo-300x60.png Paul2021-04-26 23:22:542021-04-26 23:22:54java programming assignment
Write a program that reads input for occupied hotel rooms and using the Java API, sorts
the rooms, then search for a particular room to see if it is occupied or not.
The program will utilize a loop to get input for occupied hotel rooms until a sentinel value of
your choosing is entered.
The program should utilize the Java API to sort the array of rooms.
The program then asks for input for a particular room number.
Utilize a binary search to search for a particular room and outputs “Occupied” or
The following information should be read in:
Room Number (as integer)
Binary Search Method (user written NOT the Java API)
Receives the array of hotel rooms and the room to search for as arguments.
Return true or false depending on if room is found. Output results from the main method.
Example output of your program
Example Run 1: Please enter an occupied hotel room number, -1 to quit
Please enter a room to search for: 160
This room is “Occupied”
Example Run 2: Please enter an occupied hotel room number, -1 to quit
Please enter a room to search for: 47
This room is “Unoccupied”