As a programmer, you have been asked to write a Java application, using OOP concepts, for a District. The district contains many buildings, and each building has several apartments. You need to follow the next requirements:
• The district has several buildings and each building has a unique ID (int), address (string), number_of_apartments (int), number_of_floors (int), area_meters (double), owner (string) and year_of_construction (int) with suitable data types.
• Each building could have several apartments. Each apartment has the following attributes: unique ID (int), number_of_rooms (int), type (string), floor (int), area_meters (double), owner (string), available (true or false) and price (double). Each apartment’s ID is unique within the same building, not globally. The type attributes could have one of the following values (residential, office or reserved)
At the end, you will need to create a testing class (e.g. District.java) with a static main() method with the following requirements:
• It must have initial fixed information of 2 buildings. Use classes constructors to initialize these buildings objects.
• The program will print a selection screen where the user can choose the operation which he/she wants to perform. The selection screen will be repeated after each selection until the staff types the number 7 to exit the program:
1. Add a building (by providing all its information)
2. Add an apartment within a certain existing building (by providing its information) 3. Print all buildings information 4. Display specific building data (by reading building ID from the user)
5. Display specific apartment data (by reading building ID and apartment ID from the user)
6. Display all available apartments within a certain building (by reading building ID from the user)
7. Exit the program (after printing out “Exiting from the program…” message)
• You need to create, use and print a custom exception called BuildingIDAlreadyExistsException that
should be thrown when the user tries to add a new building using existing building ID. The message
of the exception should be read as: “Invalid building ID. This building ID is already used!”