Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Java In this lab, you need to implement and test class, Package, Payment Part A (1 point) Package 1. Declare 2 class variable costPerOz:

Using Java

In this lab, you need to implement and test class, Package, Payment Part A (1 point) Package 1. Declare 2 class variable costPerOz: that holds the standard shipping fee per ounce and an integer tracker. 2. Declare the follow instance variables for the Package class: trackingID: that holds the package tracking label, these is automatically generated sender: that holds the sender name recipient: that holds the recipient name weight: that holds the package weight value: that holds the packages declared value isInsured: that hold if package is insured The base class Package has the following public methods: 3. Create a constructor that takes three parameters to initialize the package isInsured, sender, and recipient. This constructor set trackingID to tracker and increment tracker 4. Create a constructor that takes 5 parameters to initialize the package. This constructor invokes the Package class constructor to initialize the first three attributes. 5. setPackageInfo method that takes two double parameters to set the weight and value. attributes. Make sure that those are set to a positive number. 6. Create setters for the following attribute weigh, value, sender, recipients 7. Create getters for each of the instance variables. 8. shippingLabel method that returns a string representation of the package trackingID, sender, and recipient. 9. shipmentCost method that calculates and returns the cost associated with shipping a certain package. The cost is calculated by multiplying the package weight by the costPerOz. 10. insuranceCost A sender can purchase insurance coverage for the package to protect against loss or damage but this incurs an additional fee. The extra insurance fee depends on the items declared package value. If the package value is up to $1000, then there is a $5.25 flat insurance fee. If the package value is up to $5000, then there is a $7.5 flat insurance fee, for more than 5000 there is a $10 flat insurance fee

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases DeMYSTiFieD

Authors: Andy Oppel

2nd Edition

0071747990, 978-0071747998

More Books

Students also viewed these Databases questions