Question: write a header file, and an accompanying .cpp file for a class for a book. The book class should include: -Fields for the authors first

write a header file, and an accompanying .cpp file for a class for a book. The book class should include:

-Fields for the authors first name, last name, an array of 10 integers for ratings (on the heap just because...), a field for the name of the book, and a field for the year in which it was published. -Two constructors

The first constructor takes as input the first name, the last name, the name of the book, the year published, and then creates and initializes the array of ratings to 0

The second constructor that takes the first name, the last name, the name of the book, the year of publication, and an array of 10 values and initializes everything accordingly.

- A destructor that does what destructors do. - A method that calculates the average rating of the book by traversing the ratings array and finding the average rating. The method should return that rating (as a double). - A method that prints out the rating, and, if the rating is 0, prints (no ratings yet). - Write a method that prints out the books information, including author information, year of publication, and average rating. - Write an operator overload for the > (or <) operator for your book class.

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!