CPSC-115 Fall 2008
Project 6 - 50 points
Due: 5:00 p.m. Tuesday December 9th.
Professor Heidi Ellis
Goal
In this project, you will gain experience with inheritance and interfaces. You will be modeling the properties that are sold in a real estate office.
This project will be completed using the following pairs:
| Teammate 1 | Teammate 2 |
|
Teammate 1 | Teammate 2 |
| Kristen Anderson | Jin Feng Liu |
|
Jake Elder | Catherine Doyle |
| Jeffrey Young | Greg Vaughan |
|
Ryan Ersland | Corazon Irizarry |
| John Wilsterman | Jesse Vazquez |
|
Chelsea Bainbridge-Donner | Nick Dragu |
Deliverables:
You must provide the following:
- 5:00 p.m. Tuesday December 9th email me a copy of all of your classes.
Overview
In this project, you are to model the properties in a small real estate office. You will model different types of properties that are for sale including land, houses and condos. You will also create a simple class to represent a realtor selling properties. The UML class diagram for the application is shown below:
Implementation Details
Below I have provided details for each of the entities shown in the UML class diagram above:
- Realtor: The Realtor class represents a realtor including the property listings that the realtor has. The Realtor class will use an array of Property to contain the various different kinds of property listings that a realtor has for sale. The Realtor class will contain functionality to add a property to the realtor's listing and to print the realtor's listings.
- Property: The Property class is abstract and contains information that is common to all kinds of properties including the MLS id, address, price and an indication if the property is sold or not. The Property class also implements the Saleable interface. This means that the Property class must contain the sell method. Note that the Property class has a mix of abstract and concrete methods. The abstract methods contain no method body and serve as placeholders for the method to be implemented in the subclasses.
- Saleable: The Saleable interface contains a single method header sell that allows a property to be sold.
- Land: The Land class represents a land listing that is to be sold. In addition to the information defined on the Property class, land also has the number of acres for the property and the features (e.g., passed perc tests, public utilities hooked up, etc.). The Land class has a mil rate. A mil rate is the percentage of the assessed value that will be paid in yearly taxes. The Land class also has a percentage of the asking price (ACCEPT_RANGE) that will be accepted in order for the land to sell. Note that the Land class implements the taxes and sell methods. The sell method should only allow the house to be sold if the offer is within the acceptable range of the price. The sold indicator should be set to true. The taxes method should calculate the taxes for the property based on the mil rate.
- Dwelling: The Dwelling class represents a dwelling listing that is to be sold. In addition to the information defined on the Property class, a dwelling also has the square footage of the dwelling, number of bathrooms and number of bedrooms for the property. The Dwelling class also has a mil rate and a percentage of the asking price (ACCEPT_RANGE) that will be accepted in order for the dwelling to sell. Note that the Dwelling class implements the taxes and sell methods. The sell method should only allow the house to be sold if the offer is within the acceptable range of the price. The sold indicator should be set to true. The taxes method should calculate the taxes for the property based on the mil rate.
- House: The House class represents a house for sale. In addition to the information inherited from the Dwelling class, the House class contains the size of the lot in acres.
- Condo: The Condo class represents a condominium for sale. In addition to the information inherited from the Dwelling class, the Condo class contains the monthly fees charged by the condo association.
Note the following hints when developing:
- The constructor of the subtypes should call the constructor of the supertype.
- The toString method of the subtypes should call the toString method of the super type.
- All of the output shown in the sample below came from various toString methods. In other words, no output was produced by the main method.
In addition to the classes shown in the UML class diagram above, you must also create a RealtorTest class. This class contains only a main method. The main method should test your application by minimally doing the following:
- Create an instance of a Realtor.
- Create at least one instance each of Land, House, and Condo instances.
- Call the sell method on several instances of the properties that you have created in the previous step.
- Add all of the properties that you created to the realtor's listing.
- Print out the realtor's listing.
A test run of such a main method might look like the following:
The Properties:
**** LAND ****
MLS ID: G32156 AVAILABLE Address: 123 Farm Rd. Price: $1000000.0
Number of acres: 120.5 Features: perc tested
**** HOUSE ****
MLS ID: G892343 SOLD Address: 23 Ridge Rd Price: $300000.0
Square foot: 2400.0 Beds: 4.0 Baths: 2.5
Lot size: 1.02
**** CONDO ****
MLS ID: G72343 AVAILABLE Address: 100A New Heights Price: $120000.0
Square foot: 1200.0 Beds: 2.0 Baths: 1.0
Fees: 400.0
**** HOUSE ****
MLS ID: G44856 AVAILABLE Address: 193 Valley Way Price: $400000.0
Square foot: 3500.0 Beds: 4.0 Baths: 3.5
Lot size: 9.2
**** CONDO ****
MLS ID: G994992 SOLD Address: 100B New Heights Price: $110000.0
Square foot: 1200.0 Beds: 2.0 Baths: 1.0
Fees: 400.0
You must abide by the following:
- Your application must perform according to the description above.
- You must use good programming style and follow Java convention as discussed in class.
Grading:
Project 6 will be graded on:
- Completeness of code.
- Correctness of code.
- Correct programming style and use of convention.
- Understandability and readability including comments and internal documentation.