Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help doing the plot A property management company manages individual properties they will build to rent, and charges them a management fee as

I need help doing the plot

A property management company manages individual properties they will build to rent, and charges them a management fee as the percentages of the monthly rental amount. The properties cannot overlap each other, and each property must be within the limits of the management companys plot. 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 number of properties handled by the company is 5.

Aggregation

Passing object to method

Array Structure

Objects as elements of the Array

Processing array elements

Copy Constructor

Junit tes

Data Element class Property.java

The class Property will contain:

Instance variables for property name, city, rental amount, owner, and plot. Refer to JavaDoc for the data types of each instance variable.

toString method to represent a Property object.

Constructors (a copy constructor and parameterized constructor) and getter and setter methods. One parameterized constructor will have parameters for property name, city, rent amount, owner, x and y location of the upper left corner of the propertys plot, the plots width and its depth. A second constructor will only have parameters for name, city, rental amount, and owner, and will generate a default x, y, width, and depth.

Data Element class Plot.java

The class Plot will contain:

Instance variables to represent the x and y coordinates of the upper left corner of the location, and depth and width to represent the vertical and horizontal extents of the plot.

A toString method to represent a Plot object

Constructors (a no-arg constructor, a copy constructor and a parameterized constructor)

A method named overlaps that takes a Plot instance and determines if it is overlapped by the current plot.

A method named encompasses that takes a Plot instance and determines if the current plot contains it. Note that the determination should be inclusive, in other words, if an edge lies on the edge of the current plot, this is acceptable.

Data Structure An Array of Property objects to hold the properties that the management company handles.

Data Manager class ManagementCompany.java

This class should not have any output functionality (e.g., no GUI-related or printing related functionality), but should take input, operate on the data structure, and return values or set variables that may be accessed with getters.

The class ManagementCompany will contain the following methods in addition to get and set methods:

Instance variables of name, tax Id, management fee, MAX_PROPERTY (a constant set to 5) and an array of size MAX_PROPERTY of Property objects.

Constructor managementCompany pass in arguments for the name of the management company, tax Id and management Fee, along with the X, Y, width, and depth of the overall plot that will be subdivided into plots for each property. A ManagementCompany object will be created.

Constructor managementCompany pass in arguments for the name of the management company, tax Id and management Fee to create a ManagementCompany object. A default plot will be created with programmer-determined values into which to subdivide the plots for each property.

Method addProperty (3 versions)

Pass in a parameter of type Property object. It will add the Property object to the properties array.

Pass in four parameters of types:

String propertyName,

String city,

double rent, and

String ownerName.

Pass in eight parameters of types:

String propertyName,

String city,

double rent,

String ownerName,

int x,

int y,

int width, and

viii.int depth.

addProperty methods will return the index of the array where the property is added. If the property is not added, it will return -1 if the parameter is null, -2 if the array is full, -3 if the plot for the property is not encompassed by the management company plot, and -4 if the plot for the property overlaps any other propertys plot.

Method totalRent Returns the total rent of the properties in the properties array.

Method maxPropertyRent-returns the String representation of the property within the properties array that has the highest fee amount. For simplicity assume that each "Property" object's fee amount is different.

Method maxPropertyIndex- returns the index of the property within the properties array that has the highest fee amount. This method will be private.

Method displayPropertyAtIndex pass in the index of the Property object in the properties array and return the string representation of the property. This method will be private.

You may need additional methods to include in this class. Follow the Javadoc files provided.

Driver class (provided)

The provided PropertyMgmDriverNoGui.java is a class that allows you to test the methods of ManagementCompany.java

GUI Driver class (provided)

A Graphical User Interface (GUI) is provided. Be sure that the GUI will compile and run with your methods. The GUI will not compile if your methods in ManagementCompany.java are not exactly in the format specified.

Do not modify the GUI.

JUnit Test

Run the JUnit test file (provided). Ensure that the JUnit tests all succeed. Do not modify the JUnit tests.

Implement the tests in ManagementCompanyTestSTUDENT

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, the owner's name, and the Plot to be occupied by the property, 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.

Write a Data Element Class named Plot that has fields specifying the X and Y location of the upper left corner of each Plot and a depth and width of each Plot. Notice that the X,Y location is at the upper left, not as in normal Cartesian coordinates, due to the grid system adopted by computer monitors.

A driver class is provided that creates rental properties to test the property manager. A Graphical User Interface is provided using JavaFX which duplicates this drivers functionality. You are not required to read in any data, but the GUI will allow you to enter the property management company and each property by hand. A directory of images is provided. Be sure to place the images directory (provided) inside the src directory in Eclipse.

Operation

When driver-driven application starts, a driver class (provided) creates a management company, creates rental properties, adds them to the property manager, and prints information about the properties using the property managers methods.

When the GUI-driven application starts (provided), a window is created as in the following screen shots which allows the user to enter applicable data and display the resulting property. The driver and the GUI will both use the same classes and methods for their operation.

The JUnit test class also tests the same classes as the driver and the GUI.

Expected output from running PropertyMgmDriverNoGui.java

Expected output from running with GUI:

/**

* A test driver class.

*

* @author Professor khandan Monshi

*

*/

public class PropertyMgmDriverNoGui {

public static void main(String[] args) {

//Create management company object

ManagementCompany m = new ManagementCompany("Alliance", "1235",6,0,0,10,10);

//Add the properties to the list of properties of the management company

System.out.println(m.addProperty("Belmar", "Silver Spring", 1200, "John Smith",0,0,1,1)); //Should add the property and display the index where the property is added to the array

System.out.println(m.addProperty("Camden Lakeway", "Rockville", 5000, "Ann Taylor",1,1,1,1)); //should display 1 to indicate the second property added

System.out.println(m.addProperty("Hamptons", "Rockville", 1250, "Rick Steves",2,2,1,1)); //should display 2 to indicate the third property added

System.out.println(m.addProperty("Mallory Square", "Wheaton", 1000, "Abbey McDonald",3,3,1,1)); //should display 3 to indicate the fourth property added

System.out.println(m.addProperty("Lakewood", "Rockville", 3000, "Alex Tan",4,4,11,11)); //should display -3 to indicate property plot is not contained in the MgmtCo plot

System.out.println(m.addProperty("Lakewood", "Rockville", 3000, "Alex Tan",0,0,2,2)); //should display -4 to indicate property plot overlaps another one

System.out.println(m.addProperty("Lakewood", "Rockville", 3000, "Alex Tan",0,6,2,2)); //should display 4 to indicate the fourth property added

System.out.println(m.addProperty("Lakewood", "Rockville", 3000, "Alex Tan",4,4,1,1)); //it should display -4 to indicate the property is not added to the array due to size

//Display the information of the property that has the maximum rent amount

System.out.println("The property with the highest rent: " + m.maxPropertyRent());

//Display the total rent of the properties within the management company

System.out.println(" Total Rent of the properties: "+m.totalRent()+ " ");

System.out.println(m); //List the information of all the properties and the total management fee

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Identify and describe limitations of ratio analysis.

Answered: 1 week ago

Question

Ty e2y Evaluate the integral dy

Answered: 1 week ago