Details of this Paper

JAVA Programming Assignment

Description

solution


Question

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;?Unoccupied?.;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;1;56;19;160;34;18;1;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;1;56;19;160;34;18;-1;Please enter a room to search for: 47;This room is ?Unoccupied

 

Paper#69387 | Written in 18-Jul-2015

Price : $22
SiteLock