Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Summary Construct a simple program using object-oriented programming concepts. Learning Objectives Write a simple program using inheritance. Description Using Java or C++, build a
Summary Construct a simple program using object-oriented programming concepts. Learning Objectives Write a simple program using inheritance. Description Using Java or C++, build a program that uses the inheritance hierarchy below. Electronics Computer Phone 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. 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. COMPLETE AND ACCURATE - Your program must compile, execute, and give accurate output. FOLLOW ALL REQUIREMENTS ACCORDING TO THE INSTRUCTIONS - Follow the instructions as written for completing this project, even if you [think you] know a "better" way to do something. COMMENTS - Include comments in your code. There must be a comment at the top of each source code or header file that includes your name, the assignment number, and a description of the code in that file. There must be comments at each important step in your algorithm that describes that step. BEST PRACTICES - Follow best practices in C++ or Java programming, including, but not limited to, appropriate use of private/public, appropriate use of classes and/or header files, sets & gets, white space, indenting, alignment, meaningful variable names, naming conventions, using statements, etc. Points will be deducted for sloppy code that is hard to read, even if it works, so pay attention to these details.
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