Menu

[Solved]Fourth Lab Semester Create Java Cli Application Enables Shipping Company Enter Package Inf Q37050726

Introduction to Inheritance HAPTER10 Additional Cost ($) Shipping Cost Before Insurance (S) 0 to 1.00 1.01 to 3.00 3.01 and o

te a class named Package with data fields for weight in ounces, shipping method, and shipping cost. The shipping method is a

In our fourth lab of the semester we will create aJava CLI application that enables a shipping company to enterpackage information in order to output final shipping costs for apackage. The shipping clerk can can choose to ship a package byair, truck or mail, and either insure it or not. Depending on theclerk’s choices and the package weight, total cost of shipping willvary.
The application will also need to handle potential exceptions suchas entering a string when an integer is expected.

We will use Exercise 7 of the textbook(Shown inimages) as our starting point. Do use the table values forshipping rates and insurance costs in your application.

However, do not automatically instantiate objects asthe exercise directs. Instead allow the shipping clerk (your user)set the parameters in terms of package weight, shipping method, andwhether to add insurance. From these parameters determine fromwhich superclass or subclass to instantiate your object.
For this lab, you will have three classes
They should be named as such:

UsePackage.java
Your main application class. You determine what logic andexceptions should be included here.

Package.java (superclass)
This class creates a package object according to the shipping costtable.

InsuredPackage.java (subclass)
This class extends the package object to create an insured packageobject according to the insurance cost table.

In terms of output, make sure to output thefollowing:
•type of package
•weight of package
•shipping method
•cost of shipping
•cost of insurance (if selected)
•total cost of shipping with insurance (if selected)

Introduction to Inheritance HAPTER10 Additional Cost ($) Shipping Cost Before Insurance (S) 0 to 1.00 1.01 to 3.00 3.01 and over 2.45 3.95 5.55 Write an application named UsePackage that instantiates at least three objects f each type (Package and InsuredPackage) using a variety of weights and shippng method codes. Display the results for each Package and InsuredPackage. Save the files as Package.java, InsuredPackage.java, and UsePackage.java Create a class named CollegeCourse that includes data fields that hold the department (for example ENG h 8. te a class named Package with data fields for weight in ounces, 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 0 method that determines the shipping cost, based on the following table 7. Crea Mail ($) .50 1.50 2.15 Truck (S) 1.50 2.35 3.25 Air (Ş) 2.00 3.00 4.50 Weight (oz.) 1 to 8 9 to 16 17 and over The Package class also contains a displayO 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: Show transcribed image text Introduction to Inheritance HAPTER10 Additional Cost ($) Shipping Cost Before Insurance (S) 0 to 1.00 1.01 to 3.00 3.01 and over 2.45 3.95 5.55 Write an application named UsePackage that instantiates at least three objects f each type (Package and InsuredPackage) using a variety of weights and shippng method codes. Display the results for each Package and InsuredPackage. Save the files as Package.java, InsuredPackage.java, and UsePackage.java Create a class named CollegeCourse that includes data fields that hold the department (for example ENG h 8.
te a class named Package with data fields for weight in ounces, 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 0 method that determines the shipping cost, based on the following table 7. Crea Mail ($) .50 1.50 2.15 Truck (S) 1.50 2.35 3.25 Air (Ş) 2.00 3.00 4.50 Weight (oz.) 1 to 8 9 to 16 17 and over The Package class also contains a displayO 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:

Expert Answer


Answer to In our fourth lab of the semester we will create a Java CLI application that enables a shipping company to enter packag… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *