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

  Calculate a checksum that is the modulo 8 sum

How do you calculate a checksum that is the modulo 8 sum of all the bytes in the following packet C4 04 03?

  Web service management

How is Web service management different from conventional distributed computing  systems management?

  Which accepts no value and returns an int

There is also an int variable called currentTemp , which has already been declared. Use the reference variable, to invoke a method to retrieve the previously set temperature and store the returned value in currentTemp .

  Timberline technology manufactures membrane circuits

Timberline Technology manufactures membrane circuits in its Northern California plant

  What is x after the following if-else statement is executed

What is x after the following if-else statement is executed? Use a switch statement to rewrite it and draw the flowchart for the new switch statement.

  New business knowing that monopoly power comes from market

Rather than spending ones time in court is it better to seek new business knowing that Monopoly power comes from market acceptance and not from a patent, a prettier product, a slick advertising campaign etc?

  Design a 3-bit non-binary counter

Design a 3-bit non-binary counter that will count in the sequence 000, 010, 011, 101, 110, 111 when the input signal X = 0, clockwise rotation. If input signal X = 1 it reverses the direction, counterclockwise

  Create a class named vehicle that acts as a super class for

Create a class named Vehicle that acts as a super class for vehicle types

  Write a c++ code that includes the following operations

Write a C++ code that includes the following operations: z=x * y z=z + 5.0 x, y, and z are floating point variables. A function (subroutine) named GetData should be declared to get data (x and y) from keyboard. The call by reference mechanism shou..

  The contenders are tortoise and hare

The contenders are Tortoise and Hare, and they begin race as investors at "tile 1" of 70 tiles The finish line is at 70 the tile. With each tick of the clock

  Write a tutorial which consists of detailed instructions

Write a tutorial which consists of detailed instructions on the use of an IP related topic (e.g., IP addressing scheme, IP routing protocols, various IP technologies, and many more) that you think important or interesting.

  Will everything eventually be ethernet / csma/cd

Is Ethernet that good that it's the predominant form of LAN? Will everything eventually be Ethernet / CSMA/CD?

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