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

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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