Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java language Write a program that estimates the rental price for the house (including the tax). The program should ask the user to select the

java language

Write a program that estimates the rental price for the house (including the tax). The program should ask the user to select the type of the house (1. Flat - 2.Villa).

If the user selects Flat:

The program should ask the user about the number of rooms (How many rooms do you need (minimum 2 - maximum 7)?). The user should insert a number between 2 -7. If the user inserts any others input, the system will display a massage (Invalid input).

The program should ask the user about the features (Which features would you like to have?) and displays features menu (a. Storage - b. Driver room - c. I need both storage and driver room - d. I dont need to have more features)

To calculate the price: consider 25000 SR for the flat with 2 rooms and for each extra room add more 5000 SR. Add more 2000 SR, if the user needs storage. Add more 1000 SR, if the user needs driver room.

If the user selects Villa:

The program should ask the user about the number of rooms (How many rooms do you need (minimum 3 - maximum 9)?). The user should insert a number between 3 -9. If the user inserts any others input, the system will display a massage (Invalid input).

The program should ask the user about the features (Which features would you like to have?) and displays features menu (a. Swimming Pool - b. Garden - c. I need both swimming pool and garden - d. I dont need to have more features)

To calculate the price: consider 50000 SR for the villa with 3 rooms and for each extra room add more 8000 SR. Add more 7000 SR, if the user needs swimming pool. Add more 5000 SR, if the user needs garden.

Finally, calculate 5% tax for the total price. Then, print the final estimation price message "The rental estimation price is: 0.0 SR". If the user inserted invalid input the total price will be Zero.

Note: Please, do not use any iterations (for or while loops) in this question.

Output:

Example1

image text in transcribed

Example2

image text in transcribed

Example3

image text in transcribed

Please, select the house type? a. Flat b. Villa How many rooms do you need (minimum 2 maximum 7)? Invalid input The estimating house rental price is 0.0 SR

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions