Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Special Instructions Use the Scanner class to code this program. Submit only your source code file (i.e., the class you create and the Demo program).

Special Instructions

Use the Scanner class to code this program.

Submit only your source code file (i.e., the class you create and the Demo program). Note: a class file you do not create is automatically generated when you run a program. Do not submit this class file).

This assignment covers concepts in Chapters 1 - 7 only. The use of code not covered in Chapter 1-7 will result in a major error per instance

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

$560,000

Park

5 or more

$700,000

Golf Course

3-4

$580,000

Golf Course

5 or more

$725,000

Lake

3-4

$620,000

Lake

5 or more

$774,000

You must design a fully object-oriented 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: $560,000

Sold?: true

Property Address: 1840 Serenity Trail

View: Golf Course

No. Bedrooms: 5

Sale Price: $725,000

Sold?: true

Property Address: 297 Lake Lure Circle

View: Lake

No. Bedrooms: 6

Sale Price: $774,000

Sold?: false

The total value of all the homes in the subdivision that have been sold is $1,285,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

Step: 3

blur-text-image

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

Microsoft Outlook 2023

Authors: James Holler

1st Edition

B0BP9P1VWJ, 979-8367217322

Students also viewed these Databases questions

Question

What are psychologys main subfields?

Answered: 1 week ago

Question

5. Recognize your ability to repair and let go of painful conflict

Answered: 1 week ago