Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Special Instructions Use the Scanner class to code this program. Program Description You work for a real estate company and are tasked with creating a

Special Instructions

Use the Scanner class to code this program.

Program Description

You work for a real estate company and are tasked with creating a system to track the sales of vacation homes in a luxury subdivision.

For each home, you must track; the street address, the view (Park, Golf Course or Lake), the number of bedrooms and whether it has been sold. The sale price of the home is based on the view and the number of bedrooms and can be calculated using the table below.

View

# Bedrooms

Sale Price

Park

3-4

$460,000

Park

5 or more

$600,000

Golf Course

3-4

$550,000

Golf Course

5 or more

$695,000

Lake

3-4

$620,000

Lake

5 or more

$794,000

You must design a fully object-oriented Java program that avoids stale data using basic object-oriented concepts such as fields, getters, setters, constructors and methods. Your program should allow the user to enter data for as many homes as they wish and handle input like that shown in the Sample Input. Note: No home has less than 3 bedrooms so include code to prevent invalid data from being stored in the system.

The program should prompt the user for all the data necessary to fully initialize the objects. Initialization should be done as efficiently as possible. Store the objects in a container that will automatically expand as objects are added to it. When the user wishes to quit, the program should display a Property Listings report (See Sample Output). The program should also display the total cost of all the homes in the subdivision that have been sold. Your programs output must exactly match the Sample Output including white space, indention, and blank lines.

Submit a Home.java class that contains the data the program must track, getters, setters, constructors, and a method to determine the sales price of a home.

Submit a Demo.java class that contains the program that demonstrates the Home class and calculates the total cost of all the homes that have been sold.

Sample Input (user input is shown in bold)

Enter Property Address: 6347 Willow Creek Lane

View:

1.Park

2. Golf Course

3. Lake

Select the view for the property: 1

Enter No. Bedrooms: 4

Enter Sold Status (T/F): t

Would you like to enter information for another home (Y/N)?: Y

Enter Property Address: 1840 Serenity Trail

View:

1.Park

2. Golf Course

3. Lake

Select the view for the property: 2

Enter No. Bedrooms: 5

Enter Sold Status (T/F): T

Would you like to enter information for another home (Y/N)?: y

Enter Property Address: 297 Lake Lure Circle

View:

1.Park

2. Golf Course

3. Lake

Select the view for the property: 3

Enter No. Bedrooms: 6

Enter Sold Status (T/F): f

Would you like to enter information for another home (Y/N)?: n

Sample Output (format of your programs output must match)

Property Listings Report

Property Address: 6347 Willow Creek Lane

View: Park

No. Bedrooms: 4

Sale Price: $460,000

Sold?: true

Property Address: 1840 Serenity Trail

View: Golf Course

No. Bedrooms: 5

Sale Price: $695,000

Sold?: true

Property Address: 297 Lake Lure Circle

View: Lake

No. Bedrooms: 6

Sale Price: $794,000

Sold?: false

The total value of all the homes in the subdivision that have been sold is $1,155,000

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_2

Step: 3

blur-text-image_3

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

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 401(k) feature?

Answered: 1 week ago