Question: Make a book class. Each book has - Title - Author - Number of pages - Number of words - Price Your book class should

Make a book class. Each book has
-Title
-Author
-Number of pages
-Number of words
-Price
Your book class should also have these two methods:
-Price per word
-Authors initials
Your authors initials method should calculate the initials based on the Authors name. Stephen Kings initials are SK.
Your book class should be easily printable (__repr__).
Your book class should be sortable based on title in alphabetical order. If there are ties sort instead by descending price per word.
Make a list of these books:
Books
-It; Stephen King; 1138 ;437,781; $14.36
-The Gunslinger; Stephen King; 224 ;55,376; $12.15
-A Tale of Two Cities; Charles Dickens; 304; 139,605; $3.99
-Going Postal; Terry Pratchett; 484; 116,380; $30.77
-Guards! Guards!; Terry Pratchett; 416 ;97,182; $16.78
Sort the books and print them out
Find the book with the highest price per word
Find the book with the lowest price per word

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!