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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started