Answered step by step
Verified Expert Solution
Question
1 Approved Answer
There are various buildings such as houses, college buildings, commercial buildings, etc. We will take this scenario. Each building has the outer wall called siding
There are various buildings such as houses, college buildings, commercial buildings, etc. We will take this scenario. Each building has the outer wall called siding which can be made of bricks, halo bricks or vinyl, cement, etc. Each building can have rooms such as Houses have living room, bedrooms, kitchen, etc. Commercial buildings have general rooms made with different square feet, so that different businesses can rent them for their purposes. These rooms also can have features such as water plumbing presentnot present, gas plumbing presentnot present, etc. You are to develop an application to create one house and one commercial building. You will ask the user questions for house and commercial building and create rooms. Finally, you will calculate the total square feet of the house and the commercial building. The scenario and question are explained more below.
For reference, I have also uploaded a class app diagram.
Design a class called "Building" with private attributes "siding" and "squarefeets". Design two classes called "House" and "Commercial" inheriting "Building".
Implement these classes in an application as follows:
Create one house and one commercial building for simplicity, for the exam. In real application you will have iterations and options to create more houses and other buildings
For House, ask the user:
Size of Living Room, Size of kitchen, Size of dining and Size of the bedroom for simplicity of exam, we will assume there is only one bedroom
Total the sizes and set it in squarefeet of the object.
Same way, ask the user for commercial building:
Imagine that this commercial building has rooms. Ask the Size for each of those rooms from the user and find the total and set it in the squarefeet of the object.
You should display total square feet of both the house and the commercial building. Design and coding of classes and inheriatance. creating instances and application of those instances. "Write a java code"
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