Question: Your application must demonstrate the following concepts: Inheritance Composition Polymorphism Abstract Classes Use of Constructors Use of Access Specifiers Text File Data Storage/Retrieval Incorporate the
Your application must demonstrate the following concepts:
- Inheritance
- Composition
- Polymorphism
- Abstract Classes
- Use of Constructors
- Use of Access Specifiers
- Text File Data Storage/Retrieval
Incorporate the following requirements into your application:
- For all classes provide the following
- Documentation at the top of the class file that includes
- Your name
- Date of development
- Assignment (e.g., CIS317 Final Practical)
- Description of the class
- Documentation within the class that indicates which of the concepts listed above are being demonstrated
- Documentation at the top of the class file that includes
- Implement the classes as shown in the UML diagram below.

- Building is the base class and is abstract
- Contains one property
- BuildingType - private, type string, description of the type of building
- Provides the following methods
- Building - protected constructor; takes one string parameter to set the BuildingType property
- GetRooms - public, abstract function definition
- ToString - public override to return a formatted string of the building information
- Contains one property
- House is derived from the Building class
- Adds the following properties:
- NumRooms - private, type integer; the number of rooms in the house
- FrontDoor - private, type Door; the house's front door object
- MainKitchen - private, type Kitchen; the house's primary kitchen object
- Includes the following methods:
- House - public constructor; takes three parameters to set NumRooms, FrontDoor, and MainKitchen properties
- GetRooms - public; returns the value of the NumRooms property
- ToString - public override to return a formatted string of the house information
- Adds the following properties:
- Door is a class that defines a Door object
- Contains the following properties
- Width - private, type integer
- Color - private, type string
- Provides the following methods
- Door - public constructor; takes two parameters to set Width and Color properties
- ToString - public override to return a formatted string of the door information
- Contains the following properties
- Kitchen is a class that defines a Kitchen object
- Contains the following properties
- Style - private, type string; description of the style of the kitchen (e.g., Modern, Contemporary, Country, Chef's)
- ApplianceBrand - private, type string; primary brand of appliances in the kitchen
- Provides the following methods
- Kitchen - public constructor; takes two parameters to set Style and ApplianceBrand properties
- ToString - public override to return a formatted string of the kitchen information
- Contains the following properties
-
- Note that the "House" class does not take a "type" parameter - in the call to the super class, the string "House" should be passed as the parameter.
- The main application must do the following
- Print a line that states "Your Name - Week 5 Final Practical Exam"
- Creat a log file named "yourname_log.txt", adding at least 5 status updates during processing
- Creat a List of type Building and add 5 House objects to the list using parameters of your choosing
- Creat a function to print the list of buildings iteratively
- Creat a function to print the list of buildings recursively (see sample output for an example)
- Print the contents of the log file
- Make sure to include comments throughout your code that indicate what concept is being demonstrated. You must have comments that include where each of the following concepts is demonstrated:
- Inheritance
- Composition
- Polymorphism
- Abstract Classes
- Use of Constructors
- Use of Access Specifiers
- Text File Data Storage/Retrieval
Sample Output:

Door -Width: int -Color: string Building -Building Type: string #Building(string type): Building +GetRooms(): int +ToString(): string House inheritance -NumRooms: int - FrontDoor: Door -Mainkitchen: Kitchen +House (int num Rooms, Door frontDoor, Kitchen mainKitchen): House +GetRooms: int +ToString(): string +Door(int width, string color): Door +ToString(): string Kitchen -Style: string -ApplianceBrand: string + Kitchen(string style, string appliance Brand): Kitchen +ToString(): string
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
