Question

In: Computer Science

A property management company manages individual properties they will build to rent, and charges them a...

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 company’s 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

Project Contents Provided:- https://openload.co/f/9kXYDsV3w6A/Assignment_%234.zip

Assignment Document:- https://openload.co/f/PojQcH-X7Zo/Asgnmt4-F2018.docx

Solutions

Expert Solution

ManagementCompany.java

public class ManagementCompany {

private String campanyName;

   private String taxID;

private double mgmFee;

private final int MAX_PROPERT = 5;

   private Property[] p;

// added a private variable to keep the count of number of properties added

private int numProperties;

   public ManagementCompany(String name, String Id, double fee) {

       p = new Property[5];

       campanyName = name;

       taxID = Id;

       mgmFee = fee;

       numProperties = 0;

   }

   public int getMAX_PROPERTY() {

       return MAX_PROPERT;

   }

   public int addProperty(Property property) {

       if (numProperties < MAX_PROPERT) {

           p[numProperties] = property;

           numProperties++;

           return 1;

       }

       // returning -1 if Property array is full and we are unable to add the

       // new property

       return -1;

   }

   public double totalRent() {

       int total = 0;

       for (int i = 0; i < numProperties; i++) {

           total += p[i].getRentAmount();

       }

       return total;

   }

   public int maxPropertyRentIndex() {

       int maxIndex = 0;

       for (int i = 0; i < numProperties; i++) {

           if (p[i].getRentAmount() >= p[maxIndex].getRentAmount()) {

               maxIndex = i;

           }

       }

       return maxIndex;

   }

   public String displayPropertyAtIndex(int i) {

       if(i>numProperties-1)

       {

           return "Invalid index";

       }

       return p[i].toString();

   }

   public String toString() {

       String s="";

       for(int i=0;i<numProperties;++i)

       {

           s+=p[i].toString()+"\n";

       }

       s+="Total management fee collected is "+calculateTotalFee()+"\n";

       return s;

   }

  

   private double calculateTotalFee()

   {

       double fee=0;

       for(int i=0;i<numProperties;++i)

       {

           fee+=mgmFee*p[i].getRentAmount()/100;

       }

       return fee;

   }

}

Property.java

public class Property {

private String propertyName;

   private String cityName;

private double rentAmount;

   private String ownerName;

   public Property(Property p) {

       this.cityName=p.getCity();

       this.ownerName=p.getOwner();

       this.propertyName=p.getPropertyName();

       this.rentAmount=p.getRentAmount();

   }

   public Property(String property, String city, double rent, String owner) {

       propertyName = property;

       cityName = city;

       rentAmount = rent;

       ownerName = owner;

   }

   public String getPropertyName() {

       return propertyName;

   }

   public void setPropertyName(String property) {

       propertyName = property;

   }

   public String getCity() {

       return cityName;

   }

   public void setCityName(String city) {

       cityName = city;

   }

   public double getRentAmount() {

       return rentAmount;

   }

   public void setRentAmount(double rent) {

       rentAmount = rent;

   }

   public String getOwner() {

       return ownerName;

   }

   public void setOwner(String owner) {

       ownerName = owner;

   }

   public String toString() {

       return "Property Name :"+propertyName+" City :"+cityName+" Rent :"

               +rentAmount+" Owner :"+ownerName;

   }

}

public class PropMgrDriverClass{

public static void main(String[] args) {

//Create property objects
Property p1 = new Property ("Belmar", "Silver Spring", 1200, "John Smith");
Property p2 = new Property ("Camden Lakeway", "Rockville", 5000, "Ann Taylor");
Property p3 = new Property ("Hamptons", "Rockville", 1250, "Rick Steves");
Property p4 = new Property ("Mallory Square", "Wheaton", 1000, "Abbey McDonald");
Property p5 = new Property ("Lakewood", "Rockville", 3000, "Alex Tan");
//Create management company object
ManagementCompany m = new ManagementCompany("Alliance", "1235",6);

//Add the properties to the list of properties of the management company
System.out.println(m.addProperty(p1)); //Should add the property and display the index where the property is added to the array
System.out.println(m.addProperty(p2));
System.out.println(m.addProperty(p3));
System.out.println(m.addProperty(p4));
System.out.println(m.addProperty(p5));
System.out.println(m.addProperty(p5)); //it should display -1 to indicate the property is not added to the array

//Display the information of the property that has the maximum rent amount
System.out.println("The property with the highest rent:\n" + m.displayPropertyAtIndex(m.maxPropertyRentIndex()));

//Display the total rent of the properties within the management company
System.out.println("\nTotal Rent of the properties: "+m.totalRent()+ "\n");

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

Output:

1

1

1

1

1

-1

The property with the highest rent:

Property Name :Camden Lakeway City :Rockville Rent :5000.0 Owner :Ann Taylor

Total Rent of the properties: 11450.0

Property Name :Belmar City :Silver Spring Rent :1200.0 Owner :John Smith

Property Name :Camden Lakeway City :Rockville Rent :5000.0 Owner :Ann Taylor

Property Name :Hamptons City :Rockville Rent :1250.0 Owner :Rick Steves

Property Name :Mallory Square City :Wheaton Rent :1000.0 Owner :Abbey McDonald

Property Name :Lakewood City :Rockville Rent :3000.0 Owner :Alex Tan

Total management fee collected is 687.0


Related Solutions

A property management company manages individual properties they will build to rent, and charges them a...
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 company’s 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 Concepts...
This is the requirement: A property management company manages personal rental properties and charges them a...
This is the requirement: 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...
A property owner charges a rent of $30 in the first year, $34 in the second...
A property owner charges a rent of $30 in the first year, $34 in the second year, and $36 in the third year, but provides two months of free rent in the first year as a concession. Using an 8 percent discount rate, what is the effective rent over the three years? a) $32.18 b) $33.27 c) $33.89 d) $34.91
Green Properties Group owns, manages, and develops real property. Jones Group, Inc. also develops real property....
Green Properties Group owns, manages, and develops real property. Jones Group, Inc. also develops real property. Green entered into agreements with Jones concerning a large tract of property in Georgia. The parties formed NewGroup, LLC, to develop various parcels of the tract for residential purposes. The operating agreement of NewGroup indicated that “no Member shall be accountable to the LLC or to any other Member with respect to any other business or activity even if the business activity competes with...
Design and build objects to be used by a real estate company for listing the properties for sale. A base object of a property is necessary.
IN JAVA OOPDesign and build objects to be used by a real estate company for listing the properties for sale. A base object of a property is necessary. Decide what common about all properties and include these in the property object. Different type of properties are land, commercial and residential. A residential property can be single family and multi family. A commercial can be a commercial can be either a farm or non-farm.Look at real estate websites and decide what...
13. A property management group is interested in diversifying its company to operate properties for low-income...
13. A property management group is interested in diversifying its company to operate properties for low-income housing, but the group members are nervous about the impact on the brand of high-end apartment developments where they have been operating. What strategy should the property management group use to diversify but keep control of both divisions? a.Related diversification b. Internal new venture c. Unrelated diversification d. Joint venture 14. Which of these companies is pursuing a strategy of unrelated diversification? a.Best Buy...
Mel O’Conner operates rental properties in Michigan. Each property has a manager who collects rent, arranges...
Mel O’Conner operates rental properties in Michigan. Each property has a manager who collects rent, arranges for repairs, and runs advertisements in the local newspaper. The property managers transfer cash to O’Conner monthly and prepare their own bank reconciliations. The manager in Lansing has been stealing from the company. To cover the theft, he overstates the amount of the outstanding checks on the monthly bank reconciliation. As a result, each monthly bank reconciliation appears to balance. However, the balance sheet...
Jim Coleman, Jr. was appointed the manager of Maris Properties, a recently formed company that manages...
Jim Coleman, Jr. was appointed the manager of Maris Properties, a recently formed company that manages residential rental properties. Linda Grider is the accountant. She prepared a chart of accounts based on an analysis of the expenditures of the company. Two of the largest expense categories are Travel and Entertainment. Mr. Coleman believes that it is important to maintain a presence in the social life of the city. In this, he sharply differs from his father, Jim Coleman, Sr. The...
Jim Coleman, Jr. was appointed the manager of Maris Properties, a recently formed company that manages...
Jim Coleman, Jr. was appointed the manager of Maris Properties, a recently formed company that manages residential rental properties. Linda Grider is the accountant. She prepared a chart of accounts based on an analysis of the expenditures of the company. Two of the largest expense categories are Travel and Entertainment. Mr. Coleman believes that it is important to maintain a presence in the social life of the city. In this, he sharply differs from his father, Jim Coleman, Sr. The...
Jim Coleman, was appointed the manager of Maris Properties, a recently formed company that manages residential...
Jim Coleman, was appointed the manager of Maris Properties, a recently formed company that manages residential rental properties. Linda Grider is the accountant. She prepared a chart of accounts based on an analysis of the expenditures of the company. One of the largest expense categories is Travel and Entertainment. Mr. Coleman believes that it is important to maintain a presence in the social life of the city. In this, he sharply differs from his father, Randall Coleman. Randall has set...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT