Free University of Bolzano/Bozen
Faculty of Computer Science - Bachelor in Applied Computer Science
Bachelor in Production Engineering
Introduction to Programming - A.A. 2004/2005

Lab Exam 24/11/2004 (14:00)

We want to realize a program to be used in a hotel to manage booking of hotel rooms. For each room, the following information is stored: room number (a positive integer), room category (a string), name of guest who occupies the room (a string), and number of days for which the guest occupies the room (a non-negative integer). If the name of the guest is missing, this means that the room is not occupied.

Part 1. Write a class Room that implements the following methods:

Use the example program TestRoom.Java to test the class you have developed.

Part 2. Write a class UseRoom, client of Room, that contains the following public static method:

Use the example program to test the method you have developed.