Bluej
11-21-2007, 07:48 PM
im finding it hard to answer the following question -
I have to create a public method.
findVacantSeaView has no parameters and returns an integer value representing the
room number of a vacant room that has a sea view. Only even numbered rooms have a sea
view. Room zero is occupied first, then room 2, then room 4 and so on. This method will
return the next vacant room, so if rooms 0, 2, 4 and 8 are occupied, findVacantSeaView
will return 6 which is the first vacant room with a sea view. The method must return -1
if there are no vacant rooms with a sea view.
any help would be appreciated :)
I have to create a public method.
findVacantSeaView has no parameters and returns an integer value representing the
room number of a vacant room that has a sea view. Only even numbered rooms have a sea
view. Room zero is occupied first, then room 2, then room 4 and so on. This method will
return the next vacant room, so if rooms 0, 2, 4 and 8 are occupied, findVacantSeaView
will return 6 which is the first vacant room with a sea view. The method must return -1
if there are no vacant rooms with a sea view.
any help would be appreciated :)