Write a class HouseBuilder with private class members as houseArea(double, e.g. 20 square feet), houseLocation(String), story(int).  Write public default constructor, parameterized constructor, setter and getter for each class member. Also write following methods in HouseBuilder class. buildingFoundation() which prints: “building foundation by concrete and iron rods”. buildingWindows() which prints: “building class windows”. abstract void buildingWalls(); abstract void buildingPillers(); void buildHouse() which calls builFoundation(), buildWindows(); buildWalls(), buildPillers(). Write a WoodenHouse class which extends HouseBuilder and provides private class member woodType(String e.g. wood can be String, Rosewood, plyWood). Write public default constructor, parameterized constructor, setter and getter for each class member. Also provide concrete implementation to buildingWalls() and buildingPiller() methods. Example void buildingWalls() which prints: “building wooden walls for the house”. Void buildingPillers() which prints: “building wooden pillars for the house”. Write a GlassHouse class which extends HouseBuilder and provide private class member glassType(String e.g. wood can be String, Float, tempered). Write public default constructor, parameterized constructor, setter and getter for each class member. Also provide concrete implementation to buildWalls() and buildPiller() methods. Example void buildWalls() which prints: “building Glass walls for the house”. Void buildPillers() which prints: “building Glass pillars for the house”. Write a Main class with main method where you create array of type HouseBuilder e.g. HouseBuilder[] house=new HouseBuilder[2]. Initialize house[0] by WoodenHouse e.g. house[0]=new WoodenHouse(--,--,--);using parameterized Constructor. Initialize house[1] by GlassHouse e.g. house[1]=new GlassHouse(--,--,--,--);using parameterized Constructor.   Call a BuildHouse method from both of these reference variables.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter10: Introduction To Inheritance
Section: Chapter Questions
Problem 6RQ
icon
Related questions
Question

Write a class HouseBuilder with private class members as houseArea(double, e.g. 20 square feet), houseLocation(String), story(int).  Write public default constructor, parameterized constructor, setter and getter for each class member. Also write following methods in HouseBuilder class.

  1. buildingFoundation() which prints: “building foundation by concrete and iron rods”.
  2. buildingWindows() which prints: “building class windows”.
  3. abstract void buildingWalls();
  4. abstract void buildingPillers();
  5. void buildHouse() which calls builFoundation(), buildWindows(); buildWalls(), buildPillers().

Write a WoodenHouse class which extends HouseBuilder and provides private class member woodType(String e.g. wood can be String, Rosewood, plyWood). Write public default constructor, parameterized constructor, setter and getter for each class member. Also provide concrete implementation to buildingWalls() and buildingPiller() methods. Example

  1. void buildingWalls() which prints: “building wooden walls for the house”.
  2. Void buildingPillers() which prints: “building wooden pillars for the house”.

Write a GlassHouse class which extends HouseBuilder and provide private class member glassType(String e.g. wood can be String, Float, tempered). Write public default constructor, parameterized constructor, setter and getter for each class member. Also provide concrete implementation to buildWalls() and buildPiller() methods. Example

  1. void buildWalls() which prints: “building Glass walls for the house”.
  2. Void buildPillers() which prints: “building Glass pillars for the house”.

Write a Main class with main method where you create array of type HouseBuilder e.g. HouseBuilder[] house=new HouseBuilder[2].

  1. Initialize house[0] by WoodenHouse e.g. house[0]=new WoodenHouse(--,--,--);using parameterized Constructor.
  2. Initialize house[1] by GlassHouse e.g. house[1]=new GlassHouse(--,--,--,--);using parameterized Constructor.

 

Call a BuildHouse method from both of these reference variables.

Expert Solution
steps

Step by step

Solved in 4 steps

Blurred answer
Knowledge Booster
Developing computer interface
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,