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

  Create web application uses visual web java server

Create the Web application which uses Visual Web Java Server Faces framework and either Apache Tomcat or Glassfish as the server.

  Java program to print strings given at command line

Write down program Average.java to print strings which it is given at command line, one per line. If nothing is given at command line, then print "No arguments".

  Sets a loop to find 10 random generated

Write a java code that 1) uploads a file 2) sets a loop to find 10 random generated words from the file and then search those words by a. IndexSequential Method b. indexBinary Method. then, report how much time both methods took.

  Write a recursive instance method

Write a recursive instance method

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Write down the java code for the bank

Write down the java code for the bank of Fraud. User is presented with menu which looks something like this: 1. Deposit 2. Withdrawal 3. Check Balance 4. Exit.

  Write java program to select pine for furniture company

Write down the Java program for the furniture company. Ask user to select P for Pine, O for Oak or M for Mahogany.

  Create java application-input miles driven and gallons used

Create Java application which will input miles driven and gallons used (both as integers) for each tankful. Program must compute and display miles per gallon obtained for each tankful.

  Method to calculate all primes in the range [2..n]

One commonly used method to calculate all primes in the range [2..n] is to start with the number 2, mark it as prime, and mark all its multiples (excluding itself) as not prime. Then, we find the next smallest unmarked number, mark it as prime, and m..

  The string class and/or the stringbuffer class in java

Create a simple Java application that uses the String class and/or the StringBuffer class and at least 4 of the class methods. Show the code, demonstrate it works properly and describe what it is doing.

  Define private instance variable to hold boolean value

Write a Java Enumeration "LetterGrade" that represents letter grades A through F including plus and minus grades. Define a private instance variable to hold a boolean 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