Java代写:COSC2P05NiagaraRealEstateCompany


用Java代写一个房屋租赁公司。

Niagara Real Estate Company

The Niagara Real Estate Company maintains a list of properties for sale.
Properties come in four types:

  1. commercial retail
  2. commercial industrial
  3. residential
  4. farm
    All properties, regardless of their type, have the following five attributes:
  5. annual property taxes
  6. list price
  7. lot size (in square feet)
  8. location (the city)
  9. building (the building on the property)
    For convenience Niagara Real Estate has divided the Niagara Peninsula into
    four cities. These are the only valid locations:
  10. stct (St. Catharines)
  11. wlld (Welland)
  12. ngfl (Niagara Falls)
  13. fter (Fort Erie)
    All smaller cites and towns are grouped with the nearest large city.
    Commercial retail properties have one additional attribute, the retail type.
    This will be either:
  14. strip mall
  15. large mall
  16. street
    Commercial industrial properties have one additional attribute, the industry
    type. This will be either:
  17. light
  18. medium
  19. heavy
    Residential properties have four additional attributes:
  20. sewer (is the property on city sewers y/n)
  21. water (is the property on city water y/n)
  22. garage (does the property have a garage y/n)
  23. pool (does the property have a pool y/n)
    The farm property type is treated as a residential property with one
    additional attribute, the crop type. These are the only valid crop types:
  24. cash
  25. vineyard
  26. fruit
  27. poultry
    This is all the information you should need on properties. A description of
    buildings follows.
    Buildings come in three types:
  28. store
  29. factory
  30. house
    Obviously, stores go on commercial retail properties, factories go on
    commercial industrial properties, and houses go on residential and farm
    properties.
    All buildings, regardless of their type, have the following two attributes:
  31. construction material
  32. size (in square feet)
    Construction materials come in four types:
  33. brick
  34. wood
  35. siding
  36. other
    Store building types have three additional attributes:
  37. shelves (is the shelving included in the sale y/n)
  38. checkout (are the cash registers included in the sale y/n)
  39. safe (is a safe included in the sale y/n)
    Factory building types have three additional attributes:
  40. crane (is an overhead crane included y/n)
  41. equipment (is other equipment included y/n)
  42. rail access (is there railway access y/n)
    House building types have 4 additional attributes:
  43. number of bedrooms
  44. number of bathrooms
  45. basement (is there a basement y/n)
  46. house type
    House types come in the following types:
  47. condo
  48. row
  49. semi
  50. bungalow
  51. split
  52. two story

The problem

The Niagara Real Estate Company has hired you to create a program that will
search the list of the properties for sale, based on certain parameters, then
display the information on those properties that match the parameters. The
search parameters will be the city (stct, wlld, fter, ngfl), the property type
(commretail, commindust, residential, farm) and the asking price. For example,
the following search should return all of the residential properties in St.
Catharines with a list price of $500000 or less.
It is very important that you use exactly the abbreviations listed above for
your search parameters. This is to simplify marking. The marker should not
have to dig through your code to figure out what string you have used. If your
search does not run on the parameters given above your program may be marked
as inoperative. Note, to remove any ambiguity you could use radio buttons for
the city and the property type, but this is not required.
After you enter the search parameters and click the search button, the program
should return a list of properties that match the search criteria and display
the first one.
Clicking the next button will display the next property that matches the
search criteria:
If there are no more properties to display then clicking the next button
should display a message indicating this:
If you search for a different type of property, the result displayer will show
different attributes. Here we searched for commindust in wlld costing 5000000
or less. You should not use the same result displayer for all property types.
The displayer should match the property type it displays.
Even though a farm is regarded as a type of residential, it should not appear
in a search for residential properties. A farm should only appear in a search
for a farm property.

Input File Format

The list of properties is stored in a tab delimited text file. This is
available with the assignment on Sakai. The following describes the format of
the input file. This is a description of one line reading from the left. Note:
I have tested this data with many different searches and it seems to work OK.
However, I have not tried all possible combinations of location, property type
and price, so it is possible there is a bad line of data in the file. If you
think you have found bad data, please report this to me.

Programming Instructions and Hints

The purpose of this assignment is to give students practice with inheritance
and polymorphism. If your program does not use these tools, then you will get
a poor mark. This assignment involves significantly more coding than
Assignment 1. I recommend that you get started as soon as possible.
Begin by reading the problem until you understand it. Next, draw up
inheritance diagrams. Decide what variables and methods each class will have.
Write the code for these classes. Then write the code to read the input file
and create the objects. Store them in some data structure. (There is no
restriction on using library container classes in this assignment.)
Next, write the code for the search parameter GUI and the result displayer(s)
GUI. I suggest you use BasicIO for this. If you have a good understanding of
Swing and AWT then feel free to use these libraries, but there are no extra
marks for this. Your GUI does not have to be elegant or beautiful. It just has
to work.
My code used enums for things like house type, crop type, building material,
retail type and so on. This caused considerable extra work, because I had to
convert from string to enum when reading the input file then from enum to
string when I was displaying the results. I think it would be easier to keep
these variables as strings from start to finish.
I am not requiring any error checking on inputs, either in the input file, or
in the search parameter GUI. There are simply too many different possible
errors to catch and handle.
You must submit an inheritance diagram (tree drawing) with your program. It
should show your classes and the variables in each one. This can be done in
with a drawing program, or it can be done by hand then scanned. If it is done
by hand it must be neat and legible. If the marker can’t read it, he can’t
mark it.
Programs must be written in Java. You can use any IDE that is available on the
Brock Lab computers. Your program must run and compile on the lab computers or
it will not be marked. You should provide a statement specifying the IDE used
as well as any additional information needed to run your program.


文章作者: SafePoker
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 SafePoker !
  目录