Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

 

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9901711

Have any Question?


Related Questions in Computer Engineering

Discuss 5 of the most important sql server management

Discuss 5 of the most important SQL Server Management Studio (SSMS) features. Provide references - website link, book, article, etc.

Scenario your algorithm will keep track of a customers

Scenario Your algorithm will keep track of a customer's purchases at the local fireworks stand. Customers will not know exactly how many items they will purchase, so using a For loop on this lab is not allowed. Let's kee ...

Suppose our task is to distinguish between humans and

Suppose our task is to distinguish between humans and non-human objects in an image, which classifier would you choose and why? Decision trees, perceptrons or neural nets.

Question 1 why is it critical for an organization to have a

Question: 1. Why is it critical for an organization to have a DoS attack response plan well before it happens? 2. Please discuss the techniques used by malware developers to disguise their code and prevent it from being ...

A professor collected data on the number of absences in an

A professor collected data on the number of absences in an introductory statistics class of 100 students over the course of a semester. The data are summarized below. Number of Absences 0 1 2 3 4 5 6 Number of Students 5 ...

Quality management plan it should includea short statement

Quality Management Plan. It should include: A short statement that reflects your team's philosophy or objective for ensuring that you deliver a quality system to your client. Develop and describe the following that your ...

Case description mama mias mm pizzeria offers pizzas

Case Description: Mama Mia's (MM) pizzeria offers pizzas, breadsticks, and Buffalo chicken wings for carry out customers only. Customers phone in the order and come by to pick up their order. When regular customers call ...

Are search algorithms tied to data structures being

Are search algorithms tied to data structures being searched, or can they be utilized in other scenarios?

The requirements analysis phase is an essential part of a

The requirements analysis phase is an essential part of a system development methodology. According to the FAST methodology, which stake-holders typically participate in this phase? What is the primary focus of requireme ...

If we compare and contrast the four market structures it is

If we compare and contrast the four market structures, it is evident that one market structure is most practiced and evident in the United States. It is the one that promotes and strives on competition. It is the one tha ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As