0% found this document useful (0 votes)
8 views

CSC_211_Assignment_5___Inheritance_and_Operator_Overloads

The document outlines the requirements for CSC 211's C++ Assignment 5, focusing on inheritance and operator overloads. Students must create a base class 'Media' and a derived class 'Book', implementing specific attributes and methods, including operator overloading. Additionally, a 'Library' class is required to manage an array of books with proper memory management and functionality to add books and copy libraries.

Uploaded by

aiden.forsythmcd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

CSC_211_Assignment_5___Inheritance_and_Operator_Overloads

The document outlines the requirements for CSC 211's C++ Assignment 5, focusing on inheritance and operator overloads. Students must create a base class 'Media' and a derived class 'Book', implementing specific attributes and methods, including operator overloading. Additionally, a 'Library' class is required to manage an array of books with proper memory management and functionality to add books and copy libraries.

Uploaded by

aiden.forsythmcd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CSC 211: C++ Assignment 5 - Inheritance & Operator

Overloads
Todd W. Flyr
6th March, 2025

A Base Requirements
Due: Thursday, Mar 13th, midnight.
Remember for all assignments, the following are required:

• Include your name in a top of code comment

• All classes must be in their own files.

• All member variables must be private and requires accessors/mutators for control.

• All classes with dynamic data must manage it, have destructors, default ctors/ initializing
ctors, etc.

• All code must be commented.

• Turn this as an OnlineGDB link! Thank you.

• as usual, SAVE THIS CODE, WE MAY MODIFY IT IN THE NEXT ASSIGNMENT! (I’m
not sure yet, but save it just in case!)

B Technical Requirements
B-1 Base Class Implementation

Create a base class named Media with the following specifications:

• A string object for storing a title

• An integer field for storing a year (published, released)

• accessors and mutators for this member data.

B-2 Inheritance Implementation

Create one derived class (for example, Book ) that:

• Inherits from the Media class

• Adds as string attribute for an author

• Adds a string for ISBN number

• accessors and mutators for this member data.

• Overloads the == (comparison) operator to see if two books are equal. Here’s an
example of that if you need it: https://www.geeksforgeeks.org/how-to-overload-operator-
in-cpp/
B-2-1 Required Derived Class Features
The derived class must include:

• Proper constructor that calls the base class constructor

C Library Class
Create class called Library that contains a pointer to an array of Books and a string for the
owner of the library (may be a person or a school or something).
This class has the following additional requirements:

• It must have a copy constructor

• IT must have an assignment operator overload to copy one library to another.

• It must have an accessor add book to allow the user to add a book which resizes the
array.

• it must have a proper destructor for deleting dynamic memory.

D Main Function Requirements


Create a main() function that demonstrates:

• Creation of book objects, and the ability to add them to the library.

• Add a few books.

• Testing all overloaded operators (e.g. copy one library to another, prove that it works)

• Verification of proper memory management

You might also like