This is an old revision of the document!
Corning Community College
CSCS1320 C/C++ Programming
Collaborate in the creation of a useful, originally-voiced informational source on the various aspects of C++ programming, specifically inheritance, and the implementation of a simple program that has and uses a class with inheritance.
Additionally, the entire class will be participating in documenting and filling out this project page. It is the responsibility of EACH class member to:
Classes that inherit from another class acquire the attributes and behaviors of the class they inherit from.
Classes that inherit from another are called derived classes, child classes, or subclass. Classes that are inherited from are called base classes, parent classes, or superclasses.
To inherit traits from another class use a colon after the class's declaration, followed by the name of the base class (and optionally an access specifier).
class Derived : public Base
Inheriting from a base class using the public access specifier means public members of the base class will become public members of the derived class, and protected members of the base class will become protected members of the derived class. Private members of the base class will still be private.
Inheriting from a base class using the protected access specifier means both public and protected members of the base class will become protected members of the derived class. Private members of the base class will still be private.
Inheriting from a base class using the private access specifier means all members of the base class will become private members of the derived class.
Write a program that creates a parent-child class structure. It can be anything, so long as you genuinely implement it and it works. A few possible examples for inspiration:
Be sure to make use of and follow proper conventions having public, protected, and private access control (no cheating by making everything public), and demonstrate inheritance.
Have a main() function that instantiates an instance of your chosen theme of class with inheritance, and runs that instantiated object through a range of tests demonstrating the class works as intended (likely also prompting the user to input any needed values to configure the attributes of the object).
https://www.learncpp.com/cpp-tutorial/basic-inheritance-in-c/ https://www.programiz.com/cpp-programming/public-protected-private-inheritance/
I'll be looking for the following:
104:oop1:final tally of results (104/104) *:oop1:no compiler messages, program compiles and runs without issue [26/26] *:oop1:specified functionality is implemented [26/26] *:oop1:project page contributions as per project specifications [52/52]
Additionally: