Question: 1 . You will create 2 Classes, one for author information and one for book. Refer to bullet points below on the names that you
You will create Classes, one for author information and one for book. Refer to bullet points below on the names that you are to assign for each class.
Create a Author class. This class is to have the following attributes
o authorname must be defined when instance is created
o books a list of Book instances. Assign this attribute an empty list as a default value. Meaning passing a list of instances when creating an Author instance shouldnt be required. If not passed, the instance will reference an empty list.
o all attributes must be protected
Create a Book class. This class is to have the following attributes
o booknamemust be defined when instance is created
o yearpubmust be defined when instance is created
o pricemust be defined when instance is created
o quantitymust be defined when instance is created
o total automatically created when instance is created. Is the result of quantity multiplied by price
o all attributes must be protected
Define necessary methods for each one of the two classes, should include the following
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
