Create a third subclass called phone that also extends book

Assignment Help Programming Languages
Reference no: EM131299310

Assignment Instructions

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, 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 Prompt.

You are to submit the following deliverables in a single Microsoft Word file in this order, and clearly labeled.

A screen snapshot of your Java source code (all file(s) shown separately) displayed in the IDE or Windows editor showing a successful compilation, if possible (only the beginning of the source file(s) is necessary).

A listing of your entire source code file(s).

A screen snapshot of all of your program's outputs for the specified values in Step #1. Failure to show all of the output will result in lost points. In order to not confuse the grading process, and possibly lose points, do not include any other outputs aside from what is requested.

Your instructor will compile and run your program to verify its correctness.

You will be evaluated on (in order of importance):

Following directions, and inclusion and packaging of all deliverables in Step #3.

Correct execution of your program (this includes proper compilation). This also includes getting the correct answers!

Proper commenting of your Java code and indentation (as specified in the text).

Neatness in packaging of your deliverables (including putting the items in Step #3 in the correct order).

Reference no: EM131299310

Questions Cloud

Write a gui based program that analyzes a round of golf : Write a GUI based program that analyzes a round of golf. You will retrieve data for 18 holes from a text file. On each line in file will be the par for that hole (3, 4, or 5) and your core for that hole should be displayed in a label.
What is fisher equation : What is fisher equation? What does it mean? Provide 3 examples about how Fisher equation applied?
Explain the ways in which the findings might be used : In an essay, summarize the study, explain the ways in which the findings might be used in nursing practice, and address any ethical considerations associated with the conduct of the study.
Experiencing the consequence of being outbid : Explain why actually experiencing the consequence of being outbid eventually caused the bidders to change their thinking about how much to bid during the experiment.
Create a third subclass called phone that also extends book : 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.
What is the reported accuracy : There is some error due to Internet delays, but the display even tells you roughly how accurate the time on the screen is. Look up the time for your state. What is the reported accuracy?
What are general tradeoffs involved in waiting line decision : What are the general tradeoffs that are involved in waiting line decisions?- Who needs to be involved in assessing the cost of customers waiting for service?
Resulting from technological progress : Suppose the growth rate of GDP in the United States is 4.2%. If 2.9% and 1.3% of GDP growth are due, respectively, to capital and labor growth, the amount resulting from technological progress is
Calculates how much an employee would earn over a period : Write a program that calculates how much an employee would earn over a period of time (in months), if, every month, the employee' pay-per-hour rate is one dollar more than the month before.

Reviews

Write a Review

 

Programming Languages Questions & Answers

  Create security code program-display digit-ascii character

You have been hired to create the security code program. Program must permit user to enter message, one character at a time.

  Write a program that uses a structure to store the inventory

Write a program that uses a structure to store the following inventory information in a ?le. The program should have a menu that allows the user to perform the following tasks.

  Cate a function with the first line functionarrayout

create a function with the first line functionarrayout switcherooarrayin this function should take an array of any

  Void function to display in nicely formated way

Write a void function display_exer() that display in a nicely formated way the eat members of an exerclass object. Pass the object to the function by reference.

  Bubble sort or selection sort to sort list before search

Write down program to test method seq0rderedSearch. Use either the method bubbleSort or selectionSort to sort the list before the search.

  Development of a simple menu driven text adventure

Explain why NO_EXIT has been declared and used in defining the contents of the map array, rather than just directly using the value 99999 in the map array definition

  Matlab integration techniques

Use MATLAB integration techniques to determine the total Axial Elongation and explain the theory of Simpson 1/3 rule for integration in detail. Use appropriate examples to demonstrate how it works and how the integration result is computed.

  Program to calculate amount person would earn over a period

Write a program that calculates the amount a person would earn over a period of time if his or her salary is one penny the first day.

  Write script to declare and sets variable equal to balance

Write a script that declares and sets a variable that's equal to the total outstanding balance due. If that balance is greater than $10,000.00, the script should return a result set consisting of VendorName.

  Create a working program for alpha testing

you want to put together the work that has been completed to deliver a working program for alpha testing. You will combine the elements you have written to this point and deliver a working solution.

  Do you believe that html may have outlived its usefulness

HTML was the original Web page protocol, developed for hypertext documents on the emerging Web. Many different protocols and technologies have since been developed.

  Create application to read customer information from file

You have been tasked to create the application which reads customer information from file to determine in which states you have customers.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd