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

1. You will create 2 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 author_name (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 book_name(must be defined when instance is created)
o year_pub(must be defined when instance is created)
o price(must be defined when instance is created)
o quantity(must 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
2. 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 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 Programming Questions!