The School of Computing is allocated a certain number of rooms for teaching students. A database is to be formed with information about all the rooms. Members of staff will be able to interrogate the database to find which types of rooms are available; they will also require a feature which enables them to book a room.

Each Room has the following properties:

  • Room Number (String)
  • Room Type (Integer) 1=Classroom, 2=Lecture Theatre, 3=Practical Lab, 0=Other.
  • Capacity (Integer)

The application is to be built in two stages:

  • Stage 1: Rooms Database
  • Stage 2: Room Booking

You are required to develop the prototype of such a system, the prototype is being developed to test the system; all input will be via the keyboard.

Stage 1: Rooms Database

Design a class Room with the following properties:

  • roomNo string,default: ???
  • type integer, (0,1,2,3) default 0
  • capacityinteger,default: 0

Write a constructor and a method to print details of a Room on the console.

Amend your Room class by writing the following additional methods:

  • methods to set and get the properties of a Room
  • a method to ask the user for details of a Room
  • a toString() method. This should display the room type as Classroom, Lecture Theatre, Laboratory; if the room type is 0 the room type is displayed as blank.

You are advised to write a simple application to test all your methods.

Develop a menu driven application which will enable the user to:

  • add a room to the database,
  • display details of all rooms,
  • display details of a room given the room number.

Your application should incorporate data validation where appropriate.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.