Question
Summary Construct a simple program using object-oriented programming concepts. Learning Objectives Write a simple program using inheritance. Description Using C++, build a program that uses
Summary Construct a simple program using object-oriented programming concepts. Learning Objectives Write a simple program using inheritance. Description Using C++, build a program that uses the inheritance hierarchy below. Phone > Computer > Electronics File 1: Electronics Class An Electronics object has a private brand name (as a string). An Electronics object cannot be created without a brand name.
File 2: Computer Class A Computer is an Electronics object that also has a private operating system (as a string), in addition to a brand name. A Computer object cannot be created without a brand name and an operating system. File 3: Phone Class A Phone is a Computer object that also has a private phone number (as a string), in addition to an operating system and a brand name. A Phone object cannot be created without a brand name, an operating system, and a phone number. File 4: Driver Class / Program The driver class / program instantiates one object of each of the above classes. Remember to pass in the appropriate kind of data to the constructor. Then print each object, using the following format: Brand Name = ________ Brand Name = ________, Operating system = ________ Brand Name = ________, Operating system = ________, Phone number = _________ Be sure to call the appropriate parent class method/function. General Requirements for All Classes Each class must include any appropriate methods/functions, such as getters and/or setters, a constructor, and any other needed methods/functions. Be sure to use the appropriate access modifiers. Invoke base class / superclass constructors where appropriate.
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