Question: I need help creating object files for the following classes. I am a beginner and need to understand : #ifndef AUTHOR _ NARRATOR _ H

I need help creating object files for the following classes. I am a beginner and need to understand : #ifndef AUTHOR_NARRATOR_H
#define AUTHOR_NARRATOR_H
#include
#include
#include "Book.h"
class AuthorNarrator {
private:
std::string name;
std::vector authoredBooks;
public:
// Constructor
AuthorNarrator(const std::string& name);//initializes an author/narrator with a given name
// Destructor
~AuthorNarrator();//cleans up memory for books
// Getters
std::string getName() const;//returns the name of the author/narrator
std::vector getAuthoredBooks() const;//returns the lists of books by the author/narrato
// Setters
void setName(const std::string& name);//sets the name of the author/narrator
// Other methods
void addAuthoredBook(Book* book);//adds a book by author narrator
void removeAuthoredBook(Book* book);//removes a book by author/narrator
void listAuthoredBooks() const;//lists all books by author/narrator
};
#endif // AUTHOR_NARRATOR_H.............................................#ifndef BOOK_H
#define BOOK_H
#include
#include
class AuthorNarrator; // Forward declaration
class Book {
private:
std::string title;
std::vector authors;
int publicationYear;
std::string genre;
bool isAvailable;
public:
// Constructor
Book(const std::string& title, int publicationYear, const std::string& genre);
// Destructor
~Book();
// Getters
std::string getTitle() const;
std::vector getAuthors() const;
int getPublicationYear() const;
std::string getGenre() const;
bool getAvailability() const;
// Setters
void setTitle(const std::string& title);
void setAuthors(const std::vector& authors);
void setPublicationYear(int publicationYear);
void setGenre(const std::string& genre);
void setAvailability(bool available);
// Other methods
void addAuthor(AuthorNarrator* author);//Adds an author to the book's list of authors
void removeAuthor(AuthorNarrator* author);//Removes an author the book's list of authors
void borrowBook();//Handles the process of borrowing the book
void returnBook();//Handles the process of returning the book
};.......................................................................#ifndef LIBRARY_H
#define LIBRARY_H
#include
#include
#include "Book.h"
class Library {
private:
std::string name;
std::vector books;
public:
// Constructor
Library(const std::string& name);//initializes a library with a given name
// Destructor
~Library();//cleans up memory for book
// Getters
std::string getName() const;//returns the name of the library
std::vector getBooks() const;//returns the list of books in the libary
// Setters
void setName(const std::string& name);//sets the name of the library
// Other methods
void addBook(Book* book);//add a book to the library's collection
void removeBook(Book* book);//removes a book from the library's collection
void listBooks() const;//lists all books in the library
Book* findBookByTitle(const std::string& title) const;//finds a book by it's title in the library
};...............................

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!