Modify the polymain class to create at least one of phonbook

Assignment Help Basic Computer Science
Reference no: EM13782803

Inheritance and Polymorphism

1.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.

2.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.

3.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).

Unzip the zip file

·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: EM13782803

Questions Cloud

Explain why depositing cash into a checking account : Describe one reason why the flexibility of wages and prices tend to favor the Keynesian economic view in the short run and one (1) reason why the flexibility of wages and prices tend to favor the classical economic view in the long run.
Strategic marketing process paper : How does the marketing mix help businesses create market segments? How does this in turn help to create customer loyalty?
Problems related to respiratory hazards : Provide a brief explanation of each hazard and describe a situation in which you may encounter them.
Let me not to the marriage of true minds : "Let Me Not to the Marriage of True Minds" is an example of which type of poem?
Modify the polymain class to create at least one of phonbook : 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.
In what ways are characters differentiated from one another : In what ways are the characters differentiated from one another? Looking back at the story, can you see why Tessie Hutchinson is singled out as the "winner"?
Disadvantages of the s.a.r. versus the a.p.r. : What are the advantages and disadvantages of the S.A.R. versus the A.P.R.?
Sharing of household work : Respond to the following questions: Among twin- income and dual-career families, do you think there will ever be an equal sharing of household work? Why or why not?
Source of energy for the body : 1. Which one of the following nutrients is not a source of energy for the body?

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Java homework help implement a shape hierarchy where each

implement a shape hierarchy where each twodimensional shape should contain the method getarea to calculate the area of

  Critique the idea which the cio can be a bridge between

critique the idea that the cio can be a bridge between enterprise finance marketing and sales functions. justify the

  Develop the pseudocode for the program design

Complete the hierarchy chart in Appendix H and the flowcharts in Appendix I, based on the Currency Conversion program requirements and the input-process-output table you generated in Week Two.

  Write recursivemethod returns true if linked list is sorted

public static boolean isSorted Write a recursive method that returns true if a linked list is sorted (nondecreasing) order and returns false otherwise. An empty list is considered to be sorted.

  Dynamic programming

Please provide with a detailed answer using DYNAMIC PROGRAMMING

  Modern systems have largely eliminated these delays due to

the quality of the user experience is very important to the success of an application. in the early days of computing

  Consider an automated teller machine

Consider an automated teller machine

  Give a recursive definition for the language

Give a recursive definition for the following language over the alphabet {a, b} The language AA of all words containing the substring aa

  What is the total cost for replacement

If you cannot find a good match for your current system, what might have to be purchased (processor, memory, etc.)? What is the total cost for replacement?

  Define static binding and dynamic binding

1. Define static binding and dynamic binding and give an example of each. Static binding occurs at compile time and dynamic binding occurs at run time. 2. Describe a situation when a history sensitive variable in a subprogram is useful.

  You have 10 stacks of coins

You have 10 stacks of coins, each consisting of 10 quarters. One entire stack is counterfeit, but you do not know which one. You do know the weight of a genuine quarter and you are also told that each counterfeit quarter weights one gram more than it..

  Perceptions of product create its personality

Perceptions of product create its personality. Bottom, round the back. And even there they are ugly. Is that essential? Could they not, in some small degree, give pleasure?

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