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

  Write program to convert feet and inches into centimeters

Create and execute the program. Write down the program which prompts user to enter length in feet and inches and outputs equivalent length in centimeters.

  Method takes string and integer as parameters

Write a method called multiConcat which takes a String and an integer as parameters. Return String made up of the string parameter concatenated with itself count times.

  Write a program where you create a class called bankaccount

Write a program where you create a class called BankAccount. The BankAccount class should contain a String to store the customer name and a double to store the account balance.

  Write class postfixevaluator to evaluate postfix expression

Write a class PostFixEvaluator that evaluates postfix expression such as 6 2 + 5 * 8 4 / -. Program must read a postfix expression consisting of digits and operators into a StringBuffer.

  Op-codes-add microcode to overlapping address ranges

Bmov a,b,n. This Block Move instruction moves n bytes of data from location a in memory to location b. Deal correctly with case of overlapping address ranges.

  Write a recursive-descent parser

Use any programming language you prefer to write a recursive-descent parser that parses the language generated by the following EBNF descriptions.

  Create a simple shell

Create a simple shell. Basically your shell should read the line from standard input, parse the line with command and arguments, and operate the command with arguments.

  Ruby on rials to design app

Use ruby on rials to design app. It has to have a database and at least 4 pages Style is free you can design it as the way that you like

  Create a base class that contains all of the properties

Create a base class (also called a superclass) that contains all of the properties that are common to both of these products. Create 2 derived classes (also called subclasses) that contain different kinds of sizes.

  Problem in both iterative approach and recursive approach

Solve the problem in both iterative approach and recursive approach, compare the time between them and briefly discuss which one works faster and why.

  Write a method mincat that takes two strings s and t and

write a method mincat that takes two strings s and t and returns a new string. the returned string contains the

  Write a recursive method nmbdigits

Design and implement meanIter, the iterative version of the method - Write a recursive method nmbDigits which takes an integer value as parameter and returns the number of digits of the parameter value

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