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:

1. annual property taxes
2. list price
3. lot size (in square feet)
4. location (the city)
5. 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:

1. stct (St. Catharines)
2. wlld (Welland)
3. ngfl (Niagara Falls)
4. 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:

1. strip mall
2. large mall
3. street

Commercial industrial properties have one additional attribute, the industry type. This will be either:

1. light
2. medium
3. heavy

Residential properties have four additional attributes:

1. sewer (is the property on city sewers y/n)
2. water (is the property on city water y/n)
3. garage (does the property have a garage y/n)
4. 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:

1. cash
2. vineyard
3. fruit
4. poultry

This is all the information you should need on properties. A description of buildings follows.

Buildings come in three types:

1. store
2. factory
3. 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:

1. construction material
2. size (in square feet)

Construction materials come in four types:

1. brick
2. wood
3. siding
4. other

Store building types have three additional attributes:

1. shelves (is the shelving included in the sale y/n)
2. checkout (are the cash registers included in the sale y/n)
3. safe (is a safe included in the sale y/n)

Factory building types have three additional attributes:

1. crane (is an overhead crane included y/n)
2. equipment (is other equipment included y/n)
3. rail access (is there railway access y/n)

House building types have 4 additional attributes:

1. number of bedrooms
2. number of bathrooms
3. basement (is there a basement y/n)
4. house type

House types come in the following types:

1. condo
2. row
3. semi
4. bungalow
5. split
6. 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. see image.

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. see image.

Clicking the next button will display the next property that matches the search criteria: see image.

If there are no more properties to display then clicking the next button should display a message indicating this: see image.

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. see image.

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.

char buildingType s (store), f (factory), h (house)

if buidlingType is s

int sqft (building size in square feet)
String Material (building material given by brick, wood, siding,
other)
boolean shelves (is shelving included in the sale y/n)
boolean checkout (is the checkout equipment included y/n)
boolean safe (is a safe included y/n)

if buildingType is f

int sqft (building size in square feet)

String Material (building material given by brick, wood, siding,
other)
boolean crane (is an overhead crane included y/n)
boolean equipment (is other equipment included y/n)
boolean railAccess(does the factory have rail access y/n)
if building type is h
int sqft (building size in square feet)
String Material (building material given by brick, wood, siding,
other)
String houseType (type of house given by condo, row, semi, bungalow,
split, twostory)
int bedrooms (the number of bedrooms)
int bathrooms (the number of bathrooms)
boolean bsmt (does the house have a basement y/n)
char propType r (residential), i (industrial), s (store retail),
f (farm)

if propType is r
int tax (annual property tax)
int price (the list price)
int lotSize (the lot size in square feet)
String Location (the municipality given by stct, wlld, ngfl, fter)
boolean sewer (is the property on city sewers y/n)
boolean water (is the property on city water y/n)
boolean garage (does the property have a garage y/n)
boolean pool (does the property have a pool y/n)
if propType is i
int tax (annual property tax)
int price (the list price)
int lotSize (the lot size in square feet)
String Location (the municipality given by stct, wlld, nglf, fter)
IndustryType (light, medium, heavy)
if propType is s
int tax (annual property tax)
int price (the list price)
int lotSize (the lot size in square feet)
String Location n (the municipality given by stct, wlld, nglf, fter)
String RetailType (stripmall, largemall, street)
if propType is f
int tax (annual property tax)
int price (the list price)
int lotSize (the lot size in square feet)
String Location (the municipality given by stct, wlld, nglf, fter)
boolean sewer (is the property on city sewers y/n)
boolean water (is the property on city water y/n)
boolean garage (does the property have a garage y/n)
boolean pool (does the property have a pool y/n)
String CropType (cash, vineyard, fruit, poultry)
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.