Picky publishing house publishes stories

Assignment Help JAVA Programming
Reference no: EM13161749

Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. Include get and set methods for each field. The method that sets the number of pages is abstract. Also include constants for the page limits in each category. Create three Story subclasses named Novel, Novella, and ShortStory, each with a unique setPages() method. A Novel must have more than 100 pages, a Novella must have between 50 and 100 pages inclusive, and a ShortStory must have fewer than 50 pages. If the parameter passed to any of the set methods in the child class is out of range, set the page value but also create and store a message that indicates how many pages must be added or cut to satisfy the rules for the story type. Write an application named StoryDemo that creates an array of at least six objects to demonstrate how the methods work for objects created both with valid and invalid page counts for each story type. For each story, display the title, author, page count, and message if any was generated. Figure 11-34 shows a sample execution. Save the files as Story.java, Novel.java, Novella.java, ShortStory.java, and StoryDemo.java.

Reference no: EM13161749

Questions Cloud

Page file is stored in a solid state drive : Assuming that the page file is stored in a Solid State Drive (SSD) and the Translation Look-aside Buffer (TLB) is stored in cache, what is the Effective Access Time (EAT) of a memory access in a memory subsystem
Write a method called writenums : Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the
Company a has about 100 employees : Company A has about 100 employees spread over three locations in the same city, all linked by fast network connections. The IT/IS administration is centralized and includes the helpdesk.
Federal tax rates : The information above are federal tax rates but I don't understand what it means so I'm not sure how to solve the problem. What I did was sort into 4 intervals
Picky publishing house publishes stories : Picky Publishing House publishes stories in three categories and has strict require- ments for page counts in each category. Create an abstract class named Story that includes a story title, an author name, a number of pages, and a String message. In..
Application that includes three arrays : Design an application that includes three arrays of type int. Allow the user to enter values into the first two. Write a method to store the product of the two arrays in the third array
Network engineer, you are presented : As the network engineer, you are presented with the following, 172.16.0.0. / 18 IP addressing information and are asked to identify all of the possible subnet ID from the list below, assuming that the /18 subnet is used throughout the network. (Choos..
Assembly language program that generates and displays : Write a assembly language program that generates and displays 20 random strings, each consisting of ten letter(A-Z, a-z)s or number(0-9)s.
Cleint software so that it does not display : Rewrite the cleint software so that it does not display an echo of a message sent by the users. Maybe it means that each time a user tries to send a private message that same message is also sent back to them? summary: stop that from happening?

Reviews

Write a Review

 

JAVA Programming Questions & Answers

  Huge integer class

Huge Integer Class) Create a class HugeInteger which uses a 40-element array of digits to store integers as large as 40 digits each. Provide methods parse, toString, add and subtract. Method parse should receive a String, extract each digit using met..

  Java project

Prompt the user for an int between lower and upper boundary.

  Fixing errors in a java program

You coded the following on line ten of the class MyApplet.java:

  Write a program to find solution tocryparithmetic puzzle

Write a program (Crypta.java) that finds a solution to the cryparithmetic puzzle: TOO + TOO + TOO+ TOO = GOOD

  Create a class safestack that implements a stack of strings

Create a class SafeStack that implements a stack of strings

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Write java program to receive input and displayed interest

Write a Java program that receive some input and displayed the interest. Format the number into 2 decimal places. Using loop is an advantage.

  Write complete java program to read from keyboard

Write complete Java program to read, from keyboard, a student's first and last name and six grades. It will display on screen last name then first letter of first name with a period.

  Write java program which will permit user to make selection

Write the Java Program which will permit the user to make selection. You will present user with two options to perform, then you will perform action selected by user.

  Create a project in eclipse

Create a new project

  Design and implement an applet called circles

Design and implement an applet called Circles that draws 50 circles of random diameter in random locations. If the diameter of a circle is less than a certain value, the circle is ?lled with the color yellow.

  Implement a class quiz

Implement a class Quiz that implements the Measurable interface.

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