Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a class named Package with data fields for wrghtin ounces, shipping method, and shipping cost The shipping method is a character: A for air,
Create a class named Package with data fields for wrghtin ounces, shipping method, and shipping cost The shipping method is a character: A for air, T for truck, or Mfor mail. The Package class contains a constructor that requires arguments for weight a shipping method. The constructor calls a calculateCostl method chat determines the shipping cost based an the follow ng table: Weight loz) Air i5) Truck (S Mai to 8 2.00 50 to 15 3.00 ? and over 450 The package c ass also contains a disp method that displays the values in all four fields. Create a subclass armed InsuredPackage t atac an n surance cost to the sh co toas onchefo o bl tional Cost Shipping Cost Before Insurance (S) 0 tO 1.00 ddi 13 45 01 to 3.00 01 and over write an application amed Us Package that instantiates at least three o ects of each type Package and insure Package sin a variety of ei tsa s sp ng m es so ri er ts re Pack ge 3 ns red u s er eme ackage.java, InsuredPackage.java, and UePackagejava
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started