Question: Can you help me with this java question please A building manager needs to keep track of the people living in his building. A building
A building manager needs to keep track of the people living in his building. A building has several apartments. Each apartment is occupied by several tenants (persons). Write the following classes to model the above problem. Class Person: Attributes: name (String), age (int Methods: Constructor with two parameters, setters and getters, toString0 Class Apartment Attributes: apNumber (Int), noOrTenants (int), occupied (Boolean), an array of Persons living in that apartment (or ArrayList). Methods: Constructor with one parameter (apNumbec) that sets numberOfTenants to zero and occupied to false, setters and getters, addTenant) that adds a person to the list of persons living in that apartment (this method takes a person as input parameter), toString) Class Building Attributes: address (String), and array of apartments (or ArrayList). Methods: Constructor with two parameters (address and NumberOfApartments) which creates and initializes the array of apartments to the given number to empty appertments setters and getters a method to return the total number of people in the building a method to return the number of occupled apartments in the building a method to return the average number of people per apartment a toString0 method to display all information about the building. Test your class with the following Frames: Number of pal bu The button "Display" displays the building in the text area, as well as the statistics in the text fields
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
