Please, I want the full code with step-by-step explanation.
Question 1:
Using C++, write a program for a Library System which includes the use of inheritance, aggregation, and composition to model the relationships between the various entities in the library system.
Add the following classes in the Library System:
1. personType
- firstName: string
- lastName: string
* print(): void
+ setName(string, string): void
2. dateType
- dMonth: int
- dDay: int
- dYear: int
* setDate(int, int, int): void
+ getLastName(): string
+ getYear(): int
3. Create a class Client, inherited from the class personType, with an additional data member to store a Client's LibraryID no. and Date of Birth. Add appropriate constructors and methods to initialize, access, and manipulate the data members. (Use dateType to store the Client's Date of Birth)
4. Create a class Book with data members to store a Client's ID no., Book Title, Author Name, ISBN, and publication date of the Book. Add appropriate constructors and methods to initialize, access, and manipulate the data members.
5. Create a class Library, inherited from the class personType, with additional data members to store a Librarian Name, Total Book Copies, borrowed date of the book, and returning date of the book. (Use the class dateType to store the borrowed date of the book, returning date of the book, and class Book to store the total book copies). Add appropriate constructors and methods to initialize, access, and manipulate the data members.
Write a program to test your classes.