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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education