Question: Create two programs for these .html files. A property management company manages personal rental properties and charges them a management fee as the percentages of
Create two programs for these .html files.
A property management company manages personal rental properties and charges them a management fee as the percentages of the rent amount. Write an application that lets the user create a management company and add the properties managed by the company to its list. Assume the maximum properties handled by the company is 5.
Write a Data Manager Class named ManagementCompany that holds a list of properties in an array structure. This class will have methods to add a Property object to the company list, find property that has the highest rent amount, find the total rent of the properties and show the information of all the properties and the management fee earned by the management company. Follow the Javadoc file provided.
Write a Data Element Class named Property that has fields to hold the property name, the city where the property is located, the rent amount, and the owner's name, along with getters and setters to access and set these fields. Write a parameterized constructor (i.e., takes values for the fields as parameters) and a copy constructor (takes a Property object as the parameter). Follow the Javadoc file provided.
A driver class with no GUI (PropertyMgmDriverNoGui.java) is provided that creates rental properties and tests the property managers functionality. You also need to implement a Graphical User Interface using JavaFX which duplicates this drivers functionality. The GUI will allow you to enter the information for the property management company and the rental properties managed by it.
When driver-driven application starts (provided), it creates a property management company and some rental properties, adds them to the list of the properties managed by the property management company, and prints information about the properties using the property managers methods.
When the GUI-driven application starts, a window should be created as in the following screen shots which allows the user to enter data for management company and its rental properties.The driver and the GUI will both use the same classes for their operation.
file1
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Class ManagementCompany
java.lang.Object
ManagementCompany
public class ManagementCompany
extends java.lang.Object
Represents management company object
Author:
| Field Summary | |
| private int | MAX_PROPERTY |
| private double | mgmFeePer |
| private java.lang.String | name |
| private Property[] | properties |
| private java.lang.String | taxID |
| Constructor Summary | |
| ManagementCompany(java.lang.String name, java.lang.String taxID, double mgmFee) Constructor Creates a ManagementCompany object using the passed informations. | |
| Method Summary | |
| int | addProperty(Property property) Adds the property object to the "properties" array. |
| java.lang.String | displayPropertyAtIndex(int i) Displays the information of the property at index i |
| int | getMAX_PROPERTY() Return the MAX_PROPERTY constant that represent the size of the "properties" array. |
| int | maxPropertyRentIndex() This method is returning the index of the property with the maximum rent amount. |
| java.lang.String | toString() Displays the information of all the properties in the "properties" array. |
| double | totalRent() This method accesses each "Property" object within the array "properties" and sums up the property rent and returns the total amount. |
| Methods inherited from class java.lang.Object |
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
name
private java.lang.String name
taxID
private java.lang.String taxID
properties
private Property[] properties
mgmFeePer
private double mgmFeePer
MAX_PROPERTY
private final int MAX_PROPERTY
See Also:
Constant Field Values
| Constructor Detail |
ManagementCompany
public ManagementCompany(java.lang.String name,
java.lang.String taxID,
double mgmFee)
Constructor Creates a ManagementCompany object using the passed informations. "properties" array is initialized here as well.
Parameters:
name - management company name
taxID - tax id
mgmFee - management fee
| Method Detail |
getMAX_PROPERTY
public int getMAX_PROPERTY()
Return the MAX_PROPERTY constant that represent the size of the "properties" array.
Returns:
the MAX_PROPERTY a constant attribute for this class that is set 5
addProperty
public int addProperty(Property property)
Adds the property object to the "properties" array. It returns either -1 if the array is full or the index in the array where the property was added successfully.
Parameters:
property - a property object
Returns:
-1 if the array is full , otherwise return the index of the array where the property was added.
totalRent
public double totalRent()
This method accesses each "Property" object within the array "properties" and sums up the property rent and returns the total amount.
Returns:
total rent
maxPropertyRentIndex
public int maxPropertyRentIndex()
This method is returning the index of the property with the maximum rent amount. NOTE: For simplicity assume that each "Property" object's rent amount is different.
Returns:
int , the index of the property with the maximum rent amount
displayPropertyAtIndex
public java.lang.String displayPropertyAtIndex(int i)
Displays the information of the property at index i
Parameters:
i - The index of the property within the array "properties"
Returns:
information of the property at index i
toString
public java.lang.String toString()
Displays the information of all the properties in the "properties" array.
Overrides:
toString in class java.lang.Object
Returns:
information of ALL the properties within this management company by accessing the "Properties" array. The format is as following example: List of the properties for Alliance ,taxID: 1235 ______________________________________________________ Property Name : Belmar Located in baltimore Belonging to:John Smith Rent aAmount: 1200.0 Property Name : Camden Lakeway Located in baltimore Belonging to:Ann Taylor Rent Amount: 2450.0 Property Name : Hamptons Located in baltimore Belonging to:Rick Steves Rent Amount: 1250.0 ______________________________________________________ total management Fee: 294.0
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
file 2
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All ClassesAll Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Class Property
java.lang.Object Property
public class Property
extends java.lang.Object
Represents a Property object
Author:
| Field Summary | |
|---|---|
| private java.lang.String | city |
| private java.lang.String | owner |
| private java.lang.String | propertyName |
| private double | rentAmount |
| Constructor Summary | |
|---|---|
| Property(Property p) Copy Constructor, creates a new object using the information of the object passed to it. | |
| Property(java.lang.String propertyName, java.lang.String city, double rentAmount, java.lang.String owner) Constructor, Parametarized constructor | |
| Method Summary | |
|---|---|
| java.lang.String | getCity() |
| java.lang.String | getOwner() |
| java.lang.String | getPropertyName() |
| double | getRentAmount() |
| void | setLoc(java.lang.String city) |
| void | setOwner(java.lang.String owner) |
| void | setPropertyName(java.lang.String propertyName) |
| void | setRentAmount(double rentAmount) |
| java.lang.String | toString() |
| Methods inherited from class java.lang.Object |
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
propertyName
private java.lang.String propertyName
city
private java.lang.String city
rentAmount
private double rentAmount
owner
private java.lang.String owner
| Constructor Detail |
|---|
Property
public Property(Property p)
Copy Constructor, creates a new object using the information of the object passed to it.
Parameters:
p - a Property object
Property
public Property(java.lang.String propertyName, java.lang.String city, double rentAmount, java.lang.String owner)
Constructor, Parametarized constructor
Parameters:
propertyName - property name
city - city where the property is located
rentAmount - rent amount
owner - the owner's name
| Method Detail |
|---|
getPropertyName
public java.lang.String getPropertyName()
Returns:
the propertyName
setPropertyName
public void setPropertyName(java.lang.String propertyName)
Parameters:
propertyName - the propertyName to set
getCity
public java.lang.String getCity()
Returns:
the city
setLoc
public void setLoc(java.lang.String city)
Parameters:
city - the city to set
getRentAmount
public double getRentAmount()
Returns:
the rentAmount
setRentAmount
public void setRentAmount(double rentAmount)
Parameters:
rentAmount - the rentAmount to set
getOwner
public java.lang.String getOwner()
Returns:
the owner
setOwner
public void setOwner(java.lang.String owner)
Parameters:
owner - the owner to set
toString
public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
the string representation of a Property object as the following format: Property name belonging to rent amount
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All ClassesAll Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
