3

The LibraryItemsClass stores the Title and the Due date. The class has two constructors;

  1. A default constructor that gives the due date a value of 0/0/0
  2. A constructor that accepts the title and gives the due date a value of 0/0/0

The Class has four functions;

  • Getter and setter for the due date
  • getter and setter for Title
  • a function that returns a boolean value on if its overdue or not. This accepts todays date.

I need to create a derived class for this, but I don't have any ideas? What could I do with this?

  • This tutorial might be helpful: http://www.cplusplus.com/doc/tutorial/classes/ – R Sahu May 05 '15 at 04:17
  • Date probably should be a class of its own. **I** would have `Date::Date()` be equal to `1/1/1` but your teacher appear to disagree with me on that particular point. Also, I disagree with his idea that there should be a setter for a Title. The due data changes each time a book is lent out, but the title does not change. – MSalters May 05 '15 at 10:39

1 Answers1

1

You can be as creative as you'd like.

Since this class describes items in a library, you can make a derived class for books, specifically a function that sets the item's genre as a string and another that can return it. You can also do a function that stores the number of pages for the book as an int and another function that can return that value.

Another derived class can be for videos in this library. Again, you can create a function that does things like hold the genre, length of the video, etc.

The main idea is to follow the theme of the inherited class of having due dates. Anything that has a due date can be derived from this class and branch out in its own uniqueness.

I hope this answer can inspire some ideas. :)

mas4
  • 989
  • 1
  • 8
  • 20