Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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
  • Implement the classes as shown in the UML diagram below.
image
  • 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
  • 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
  • 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
  • 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
  •  
    • 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:

image

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

Integrated Accounting

Authors: Dale A. Klooster, Warren Allen, Glenn Owen

8th edition

1285462726, 1285462721, 978-1285462721

More Books

Students also viewed these Programming questions

Question

What opportunities exist for raises and advancement?

Answered: 1 week ago

Question

L A -r- P[N]

Answered: 1 week ago

Question

Once calculated, all ratios should be compared to what?

Answered: 1 week ago

Question

Describe the process for deleting a general journal entry.

Answered: 1 week ago