Question: Create a class Book with the data members listed below. Include a default constructor, a constructor with parameters for each data member, and Get_ and

Create a class Book with the data members listed below. Include a default constructor, a constructor with parameters for each data member, and "Get_" and "Set" access method for each data member. For example if a class had a data member named mydata, the class would require methods named: Get_mydata and Set mydata. You must also provide the float AvgCost0 method for the class to calculate the average cost of the book (based on sales divided by units). title, which is a string (initialize to empty string) units, which is an integer value (initialize to 0) sales, which is a floating point value (initialize to 0.0) Your second constructor should take all data member variables as input in the order they are specified above. You only need to write the class definition and any code that is required for that class. Place all code within the class definition. NOTE: you must not use the implicit "private" for class data types and methods. Include public or private explicitly Answer: (penalty regime: 0%)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
