Create a third subclass called phone

Assignment Help Programming Languages
Reference no: EM13784274

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

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

Questions Cloud

Explain about domestic and global hr : Domestic and Global HR.
Explain the epistemological perspective : Explain the epistemological perspective from the text (or outside sources) that most coincides with your view of truth and the way that the human mind grasps reality.
Analysis of the financial statements and projections : Describe the ratios that should be used to raise short-term and long-term financing.
Describe at least five types of issues : What are some of the problems that you have experienced when writing or receiving poorly, perhaps hastily, written emails/texts? Describe at least five types of issues.
Create a third subclass called phone : 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.
How would his business change if he did use the cloud : Review the given case: North Point Eyewear, How would his business change if he did use the cloud? Could he use it to help him turn his online store into something similar to his physical store
What is your experience with learning social studies : What is your personal experience with learning social studies? Do you have any memories that stand out as highly effective learning experiences?
Syllogistic arguments that are missing the conclusions : To be a valid syllogism, the conclusion must be proven by the reasons. Carefully study the following syllogisms and decide if they are valid or invalid:
Assignment on quality assurance in healthcare systems : quality assurance in healthcare systems.

Reviews

Write a Review

Programming Languages Questions & Answers

  Function to count number of times the given number occured

Write a main function to input 20 integers in the range of 1 to 6. Write a function to count the number of times the numbers 2 and 5 occur. The function should declare static variables count2 and count5.

  Write program to display companys payroll report in list box

Write down the program to display companys payroll report in list box. Program must read each employee's name, hourly rate, and hours worked from file and produce report.

  Create set-list of enumerated constants called week

Create set/list of enumerated constants called week which contains days of week. Have variable called today that is of kind week. Allot a value to today.

  Scripting language programming in perl

course Scripting Language Programming,  Assignment   -  Perl,  ? Your coding style should conform to general Perl coding conventions. Your scripts should be clean, neat, and well-formatted (e.g. indention). Identifiers should also be properly name..

  Write a program to compute the probability

Write a program (or a peudocode) to compute the probability that at least 2 people have the same birthday, given there are 2, 3, 4,....,60 people in the room.

  Modeling a game using turing machine

Modeling a Game Using Turing Machine, Select a game that can be modeled by a simple Turing machine. It should take a series of inputs (such as a set of moves by a player) and use the tape and table to compute the outcome of whether the player won o..

  Using the irvine32 library functions

Create 32 random points which have (x, y) co-ordinates

  Prepare a computer program to simulate the traffic

Write a computer program to simulate the traffic on a 2D plane under different traffic light control schemes.

  Writing application to accept loan amount-interest rate

Write down the application to accept a loan amount, annual interest rate, and loan period (in number of years) and displays a table with five columns.

  Write program using array of seven long integers

Write down the program which uses the following arrays: empId: array of seven long integers to hold employee identification numbers. Array must be initialized with following numbers.

  Write unix shell script to check file in current directory

Write Unix shell script (one program) called Project1_lastname (your lastname). This script will do the following tasks: Using "if" statement checks for a file called "student.txt" in current directory.

  Write statement to allot new value to element of array

Write down single statement which allots new value to element of ArrrayList indexed by j. This new value must be equal to twice value stored in next element of ArrayList.

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