Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help badly; this is due tonight and its not running Property management java. Here are what I have writer so far: ManagementCompany.java package

I need help badly; this is due tonight and its not running Property management java.

Here are what I have writer so far:

ManagementCompany.java

package Package;

public class ManagementCompany

{ private int MAX_PROPERTY = 5;

private double mgmFee;

private String name;

private Property[] properties=new Property[MAX_PROPERTY];

private String taxID;

int index=0;

public ManagementCompany(String name, String taxID, int mgmFee) {

this.name=name;

this.taxID=taxID;

this.mgmFee=mgmFee;}

public int addProperty(Property p1) {

if(index>=MAX_PROPERTY){

return -1;}

else{

properties[index]=p1;

index++;

return index-1; } }

public String displayPropertyAtIndex(int index) {

String output=properties[index].toString();

return output; }

public int getMAX_PROPERTY() {

return MAX_PROPERTY; }

public int maxPropertyRentIndex() {

double maxRent=0;

int maxRentIndex=0;

for(int i=0;i

if(maxRent

maxRent=properties[i].getRentAmount();

maxRentIndex=i; } }

return maxRentIndex; }

public double totalRent() {

double totalRent = 0;

for(int i=0;i

totalRent+=properties[i].getRentAmount();

} return totalRent; }

public String toString() {

String output="";

for(int i=0;i

output+=properties[i].toString()+" "; }

return ("List of the properties for Mananagemen Company, "

+ "Alliance, taxid, 1235 ------------------------------------------- "+output+"------------------------------------------- total management Fee:"+this.mgmFee); } }

Property.java

package Package;

public class Property

{ private String city;

private String owner;

private String propertyName;

private double rentAmount;

public Property () {

city = "";

owner = "";

propertyName = "";

rentAmount = 0.0; }

public Property (Property p) {

propertyName = p.propertyName;

city = p.city;

rentAmount = p.rentAmount;

owner = p.owner; }

public Property(String propertyName, String city, double rentAmount,String owner) {

this.propertyName = propertyName

this.city = city;

this.rentAmount = rentAmount;

this.owner = owner; }

public void setLoc(String city) {

this.city = city; }

public String getPropertyName() {

return propertyName; }

public String getCity() {

return city; }

public double getRentAmount() {

return rentAmount; }

public void setRentAmount(double rentAmount) {

this.rentAmount = rentAmount; }

public String getOwner() {

return owner; }

public void setOwner(String owner) {

this.owner = owner; }

public String toString() {

return "Property Name: "+this.propertyName+" "+

"Located: "+this.city+" "+

"Belonging to: "+this.owner+" "+

"Rent Amount: "+this.rentAmount; } }image text in transcribedimage text in transcribed

When i run the program it brings error. I have no idea where I am wrong. All the assignment requirement is in the picture

image text in transcribed

Asgnmt4-F2018 - Saved to this PC Razafindragolo, Tanguy X File Home Insert Design Layout References Mailings Review View Help Nitro Pro ,JTell me what you want to do Share Comments Find Times New Ro* | 11 A' A" Aa- Ao daBbCeDdaBbCel AaBbCc1 AaBbCcl AaBbCc1 AaBbCel Replace E Copy Format Painter Paste Get Dictate :-. g.-1Caption Emphasis THeading 1 Heading 2 T1 Normal Strong k Select- - Add ins Clipboard Font Paragraph Styles Editing Add-ins Voice Classes Data Element class- Property.java The class Propert will contain: 1. Instance variables for property name, city, rental amount, owner, and plot Refer to JaaDoc for the data types of each instance variable 2. toString method to represent a Property object. 3. 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 comer of the property's plot, the plot's 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 (ano-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. 1. 2. 3. 4. 5. Data Structure - An Aray of Property objects to hold the properties that the management company handles. Page 1 of9 1393 words + 100% O Type here to search a

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

Recommended Textbook for

Finance The Role Of Data Analytics In Manda Due Diligence

Authors: Ps Publishing

1st Edition

B0CR6SKTQG, 979-8873324675

More Books

Students also viewed these Databases questions