Question
Hello. please answer this following question will upvote. I only need number 2 but if you can please answer number 3 as well would be
Hello. please answer this following question will upvote.
I only need number 2 but if you can please answer number 3 as well would be very helpful.
/ Library.h
#ifndef LIBRARY_H
#define LIBRARY_H
#include "Book.h"
#define MAX_ARR_SIZE 128
class Library{
private:
Book books[MAX_ARR_SIZE];
int numOfBooks;
public:
Library();
void addBook(Book &);
void print();
};
#endif
//end of Library.h
// Library.cpp
#include "Library.h"
#include
#include
using namespace std;
Library::Library()
{
numOfBooks=0;
}
void Library::addBook(Book &book)
{
if(numOfBooks
{
books[numOfBooks] = book;
numOfBooks++;
}else
cout
}
void Library::print()
{
if(numOfBooks == 0)
cout
else
{
cout
for(int i=0;i books[i].print(); } } //end of Library.cpp
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started