Create an abstract class named element

Assignment Help JAVA Programming
Reference no: EM13161131

Part 1: Create an abstract class named Element that holds properties of elements, including their symbol, atomic number, and atomic weight. Include a constructor that requires values for all three properties and a get method for each value. (For example, the symbol for carbon is C, its atomic number is 6, and its atomic weight is 12.01. You can find these values by reading a periodic table in a chemistry reference or by searching the Web.) Also include an abstract method named describeElement(). Create two extended classes named MetalElement and NonMetalElement. Each contains a describeElement() method that displays the details of the element and a brief explanation of the properties of the element type. For example, metals are good conductors of electricity, while nonmetals are poor conductors.Write an application named ElementArray that creates and displays an array that holds at least two elements of each type. Save the files as Element.java, MetalElement.java, NonMetalElement.java, and ElementArray.java.

Part2: Create a class named NewspaperSubscriber with fields for a subscriber's street
address and the subscription rate. Include get and set methods for the subscriber's
street address, and include get and set methods for the subscription rate. The set
method for the rate is abstract. Include an equals() method that indicates two
Subscribers are equal if they have the same street address. Create child classes
named SevenDaySubscriber, WeekdaySubscriber, and WeekendSubscriber. Each
child class constructor sets the rate as follows: SevenDaySubscribers pay $4.50 per
week, WeekdaySubscribers pay $3.50 per week, and WeekendSubscribers pay
$2.00 per week. Each child class should include a toString() method that returns
the street address, rate, and service type. Write an application named Subscribers
that prompts the user for the subscriber's street address and requested service, and
then creates the appropriate object based on the service type. Do not let the user
enter more than one subscription type for any given street address. Save the files as
NewspaperSubscriber.java, WeekdaySubscriber.java, WeekendSubscriber.
java, SevenDaySubscriber.java, and Subscribers.java.

Part3:Picky Publishing House publishes stories in three categories and has strict requirements
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.

Part4:Write an application named UseInsurance that uses an abstract Insurance class
and Health and Life subclasses to display different types of insurance policies
and the cost per month. The Insurance class contains a String representing the
type of insurance and a double that holds the monthly price. The Insurance class
constructor requires a String argument indicating the type of insurance, but the
Life and Health class constructors require no arguments. The Insurance class
contains a get method for each field; it also contains two abstract methods named
setCost() and display(). The Life class setCost() method sets the monthly fee
to $36, and the Health class sets the monthly fee to $196. Write an application
named UseInsurance that prompts the user for the type of insurance to bedisplayed, and then create the appropriate object. Save the files as Life.java,
Health.java, Insurance.java, and UseInsurance.java.

 

 

Reference no: EM13161131

Questions Cloud

How the resulting interference pattern will di ffer : Briefly describe how the resulting interference pattern will di ffer for the various types of particles passing through: protons, electrons, neutrinos (mass close to zero) and photons. Assume that the distribution of particle energies is the same f..
What is a sensitized sheep rbc : Briefly explain how a complement fixation test is used to determine the etiological agent of a disease or in other words whatdoes this test tell us about the patient.
Clearly label the ir spectrum of anisaldehyde : Clearly Label the IR Spectrum of Benzoic Acid and assign the following peaks: Broad 3300-2500cm-1 3020 cm-1 1682cm-1 2. Clearly Label the IR Spectrum of Anisaldehyde and assign
Remember to make only one step at a time : Prove the following. Remember to make only one step at a time and not skip steps. Remember to write what rule allowed you to make each step, and which lines you applied it to
Create an abstract class named element : Part 1: Create an abstract class named Element that holds properties of elements, including their symbol, atomic number, and atomic weight. Include a constructor that requires values for all three properties and a get method for each value.
Determine the enthalpy change for the reaction : Determine the enthalpy change for the reaction. 2NO2 (g) -> 2NO(g) + O2(g) These are the given equations: NO + O3 -> NO2 + 02 DeltaH = -198.9 kJ / mol O3 -> (3/2)O2 DeltaH = -142.3 kJ/mol
Determine the dominant and recessive expression of the gene : determine the dominant and recessive expression of the gene?
Briefly describe the process to separate the two ions : The two ions are mixed in a solution and you need to pick a chemical to add that would allow you to selectively remove one of them. Briefly describe the process you would use to separate the two ions.
Provide the rtl instructions : Provide the RTL instructions and the time steps that will facilitate the execution of the following assembly language instructions  LDA addr,x  STX addr,x

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

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