Question: Program in JAVA You have been hired by a real estate agent to write a program that will advise them if they should or should

Program in JAVA

You have been hired by a real estate agent to write a program that will advise them if they should or should not show an apartment to a client.

Your program must ask the user to enter the following information and save the values entered into variables (use the types and names below).

  • int squareFeet;
  • int bedRooms;
  • double bathrooms:
  • int floor:
  • boolean elevator;
  • boolean offStreetParking;
  • double monthlyRent;

Client A wants an apartment that:

  • is at least 600 square feet in size
  • has at least 2 bedrooms
  • has at least 2 bathrooms
  • if it is on the 4th floor or above it must have an elevator
  • has off street parking
  • costs <= $1200 per month

Client B wants an apartment that:

  • is at least 800 square feet in size
  • has at least 2 bedrooms
  • has at least 2 bathrooms
  • has off street parking
  • costs <= $1200 per month

Client C wants an apartment that:

  • is at least 600 square feet in size
  • has at least 1 bedrooms
  • has at least 1 bathrooms
  • has an elevator
  • costs <= $1200 if the building has off street parking
  • costs <= $1000 if the building does not have off street parking

Client D wants an apartment that:

  • if the apartment has 2 bedrooms it must have 2 bathrooms
  • if the apartment has 1 bedroom it must have at least 1.5 bathrooms
  • if it has off street parking it must not have an elevator
  • if it has an elevator it must not have off street parking

Here is sample input/output

Enter the apartment size in square feet: 800 Enter the number of bedrooms: 2 Enter the number of bathrooms: 2 Enter the floor: 4 Enter elevator (true or false): false Enter off street parking (true or false): true Enter the monthly rent: 1200

Show the apartment to the following:

Client B Client D

Name your program Apartment_yourInitials.java. Where yourInitials represents your initials.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!