Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA CODING PART A) Create a class named Apartment that holds an apartment number as aptNumber, number of bedrooms as bedrooms, number of baths as

JAVA CODING

PART A) Create a class named Apartment that holds an apartment number as aptNumber, number of bedrooms as bedrooms, number of baths as baths, and rent amount as rent.

Create the Apartment class.

Create the data fields for the Apartment class.

Create a default constructor that accepts no arguments and an overloaded constructor that accepts values for each data field

Create a default constructor and an overloaded constructor for the Apartment class.

Also create a get method for each field.

Create the get method for the aptNumber data field.

Create the get method for the bedrooms data field.

Create the get method for the baths data field.

Create the get method for the rent data field.

PART B) Write an application called TestApartments that creates at least five Apartment objects. Then prompt a user to enter a minimum number of bedrooms required, a minimum number of baths required, and a maximum rent the user is willing to pay. Display data for all the Apartment objects that meet the users criteria or an appropriate message if no such apartments are available.

Create the TestApartments class.

The TestApartments class accepts user input for an Apartment object.

An example of the program is shown below:

Enter minimum number of bedrooms needed >> 2 Enter minimum number of bathrooms needed >> 1.5 Enter maximum rent willing to pay >> 1200 Apartments meeting criteria of at least 2 bedrooms, at least 1.5 baths, and no more than $1200.0 rent: Apt #102 2 bedrooms, and 1.5 baths. Rent $775.0 Apt #103 3 bedrooms, and 2.0 baths. Rent $870.0 Apt #104 3 bedrooms, and 2.5 baths. Rent $960.0 Apt #105 3 bedrooms, and 3.0 baths. Rent $1100.0

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

Online Systems For Physicians And Medical Professionals How To Use And Access Databases

Authors: Harley Bjelland

1st Edition

1878487442, 9781878487445

More Books

Students also viewed these Databases questions

Question

5. Identify three characteristics of the dialectical approach.

Answered: 1 week ago

Question

6. Explain the strengths of a dialectical approach.

Answered: 1 week ago

Question

4. Explain the strengths and weaknesses of each approach.

Answered: 1 week ago