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

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  String that contains at least five letters

Write an application that prompts the user for a String that contains at least five letters and at least five digits. Continuously reprompt the user until a valid String is entered. Display a message indicating whether the user was successful or did ..

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Program to find maximum-minimum of sequence of values

Common task which should be done in loop is to find maximum and minimum of sequence of values. File Temps.java contains program which reads in sequence of hourly temperature readings over 24- hour period.

  Implement the lexical and syntactic analysis

Implement the lexical and syntactic analysis of Minifun programming language.

  Write a recursive method to produce a pattern

Write a recursive method to produce a pattern of n lines of asterisks.

  Java method that contains code to be executed

Write a short Java method that contains code for which it is probably impossible for that code to ever be executed, but your favorite Java compiler does not detect this fact.

  Design a single class that expresses the commonality

Design a single class that expresses the commonality of these concepts.

  You need to train for 10 weeks

You are preparing for a marathon. In order to prepare, you need to train for 10 weeks, running an increasing number of miles per week, starting at running at least 2 miles your first week up to 26 miles by week 10.

  Understand actual communication with an smtp server

Understand actual communication with an SMTP server can be achieved using TCP Sockets and understand the development of a graphical user interface (GUI) and use of event handling.

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

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