Inheritance and Polymorphism
Key in the PolyMain, Book, Almanac, and Novel
classes defined in this module of the course. Once you get each of
these classes keyed in, make sure they compile and execute properly.
Then create a third subclass called Phone that also extends the Book
class. The Phone class should keep track of the number of yellow pages
and the number of white pages in each phone book. Make sure the Phone
subclass you create has a print method having the same signature as the
print method in the Book class. The print method from the Phone class
should print the title of the book and the total number of pages of the
book, followed by the number of yellow pages and white pages contained
within the phone book. Thus, the print method should have the following
signature:public void print();
The Phone class should also have a constructor having the following signature:
public Phone(String title, int whitePages, int yellowPages);
This constructor should sum up whitePages + yellowPages to get the
total number of pages in the book. Remember the total pages in the book
and the title of the book are set in the constructor for the Book class.
Modify the PolyMain class to create at least one of your phone books
and store it in the library. You should now be able to print the library
without having to modify the print method defined within the PolyMain
class.You may use any Java IDE you choose to
develop your source code, compile and link your code, and execute your
program (jGRASP is recommended). Or you may use the Windows Command
Why Choose Us
- 100% non-plagiarized Papers
- 24/7 /365 Service Available
- Affordable Prices
- Any Paper, Urgency, and Subject
- Will complete your papers in 6 hours
- On-time Delivery
- Money-back and Privacy guarantees
- Unlimited Amendments upon request
- Satisfaction guarantee
How it Works
- Click on the “Place Order” tab at the top menu or “Order Now” icon at the bottom and a new page will appear with an order form to be filled.
- Fill in your paper’s requirements in the "PAPER DETAILS" section.
- Fill in your paper’s academic level, deadline, and the required number of pages from the drop-down menus.
- Click “CREATE ACCOUNT & SIGN IN” to enter your registration details and get an account with us for record-keeping and then, click on “PROCEED TO CHECKOUT” at the bottom of the page.
- From there, the payment sections will show, follow the guided payment process and your order will be available for our writing team to work on it.