Question: Please do this in c++. The default title, total pages, chapter, and edition can be anything you want. Thank you so much! You are to
You are to create a class called book with four private data members: title (character string), total number of pages (int), number of chapters (int), and edition (int). Include the following member functions: 1. Get function for each data member 2. Set function for each data member 3. Default constructor 4. Overloaded constructor 5. Function to RETURN the average number of pages per chapter (int) NOTE: You are to include error checking IN the set functions and IN the overloaded constructor for the total number of pages (>0), number of chapters (>0), and editon (>0). If any of these values are non-positive, either set the value to some default value or prompt again for a valid value. IN MAIN: Instantiate one book object using the default constructor, prompt for values for its data members, and then call the appropriate set functions to set the data members to those values. Prompt for values for another book object and use the overloaded constructor when you instantiate the second object instead of the set functions. Print out the values of all data members for both book objects as well as the average number pages per chapter. 1. 2. 3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
