Answer:
void printAllBooks(Book [] listOfBooks, int numberOfBooks){
bool flag = false;
if(numberOfBooks == 0){
cout<< "No books are stored";
} else{
cout<< "Here is a list of the books \\";
for (int i =0; i < numberOfBooks; ++i){
cout<< listOfBooks[i];
}
}
}
Step-by-step explanation:
The void keyword in the "printAllBooks" function is used for a function that has no return statement. The function accepts two parameters, "listOfBooks" which is the array of book objects, and "numberOfBooks" which is the size of the array of objects. The function uses a for loop statement to print out the book in the array if the numberOfBooks variable is greater than zero.