Create a class named package with data fields for weight

Assignment Help Computer Engineering
Reference no: EM13322409

Create a class named Package with data fields for weight in ounces (oz.), shipping method, and shipping cost.

The shipping method is a character: ‘A' for air, ‘T' for truck, or ‘M' for mail.

The package class contains a constructor that requires arguments for weight and shipping method.

The constructor calls a calculateCost() method that determines the shipping cost based on the following table:


Weight (oz.) Air Truck Mail
1 to 8 2.00 1.50 0.50
9 to 16 3.00 2.35 1.50
17 and over 4.50 3.25 2.15

The package class also contains a display() method that displays the values in all four fields. Create a subclass named InsuredPackage that adds an insurance cost to the shipping cost based on the following table:

Shipping cost before insurance Additional cost ($)
0 to 1.00 2.45
1.01 to 3.00 3.95
3.01 and over 5.55


Write an application named UsePackage that instantiates at least three objects of each type (Package and InsuredPackage) using a variety of weights and shipping method codes.

Display the results for each Package and InsuredPackage.

Save the files as Package.java, InsuredPackage.java, and UsePackage.java.

 

Reference no: EM13322409

Questions Cloud

Find the minimum and maximum possible values of wavelength : Light passes through a 200 line/mm diffraction grating and is observed on a 1.0 m-wide screen located 1.0 m behind the grating. What are the minimum and maximum possible values of wavelength
Determine diameter of rod if it has to be subjected to load : A rod of copper alloy 50 inches long has a modulus of elasticity of 16*10^7 psi. If the maximum allowable elongation is 0.05 in, determine the diameter of the rod if it has to be subjected to a load of 3200 lb.
Standard deviation and capm beta estimates : Standard  deviation and capm beta estimates
Where is the image of your nose located : Examining your imange in a convex mirror whose radius of curvature is 24.6cm, Where is the image of your nose located
Create a class named package with data fields for weight : Create a class named Package with data fields for weight in ounces (oz.), shipping method, and shipping cost.
Explain the addition of bromine to ethene in the presence : The addition of bromine to ethene in the presence of high concentration of chloride ion in an inert solvent results in the formation of 1,2-dibromoethane and 1-bromo-2-chloroethane.
Use to assess domestic risk in an effective manner : Use to assess domestic risk in an effective manner?
Prepare an opening statement that specifies organization : The graphically depicted solution is not included in the required page length. Explain what the client can expect from your services.
What are the current limitations : Explain what are the priorities: more charges or more energy stored in batteries used to propel cars or even light planes. What are the current limitations

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Peer-to-peer networking

Explain the term peer-to-peer networking? Describe why is bit torrent regarded to be a more efficient protocol? In the bit torrent context, explain how seeders and the leechers work.

  What makes scope creep particularly prevalent in it projects

What makes scope creep particularly prevalent in IT projects? What specific IT project management tools can be used to control it - what are some possible factors that might cause scope creep in the given scenario?

  Find out the differences between the two files

Append the last two lines of each file to the file known Mollett.out without cutting and pasting (Hint: tail command can do this)

  What factors in computer design would affect the decision

What factors in computer design would affect the decision.

  What is a backup strategy or active directory?

What is a backup strategy or Active Directory? The small business that you created new domain controllers for now wants you to develop a backup and recovery plan for Active Directory.

  Designing the decision table

Design a decision table to represent the kind of treatment to be given to the customer of Eye Tunes Music Club. Produce a structured English version on the basis of following dialogue obtained by Systems Analyst from client interview.

  How to create a poster or presentation

For an on line poster presentation, you need to use PowerPoint, Visio, MS Word, or another program that allows you to use graphics and pictures along with words to tell a story. Posters are created to tell a visual story so the intent is to use le..

  Explain the z-transform of the following system transfer

Discrete Time Systems, 1. a) Find the z-transform of the following system transfer function assuming the input is a unit staircase (i.e. zero order held). The sampling rate is T=0.2.

  Process seteditable is a jtextcomponent method

Menus require a JMenuBar object so they can be attached to a JFrame.

  What aspects of environment support structure of colleges

What aspects of environment support structure of colleges.

  Develop a pac chart, interactivity chart

Develop a solution that will calculate the price of an item for each of the five days, given the original price. Test the solution for an item costing $10.00. Develop a PAC Chart, Interactivity Chart,IPO chart, Algorithm, and Flowchart

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