Question: In java pleaseeee ;) The following class is used to represent parcels delivered by a company. Class: Parcel Attributes: String id char destination double weight

 In java pleaseeee ;) The following class is used to represent

In java pleaseeee ;)

The following class is used to represent parcels delivered by a company. Class: Parcel Attributes: String id char destination double weight double charge a) Define the constructor for class Parcel and write the accessor for all attributes and setter methods for suitable attributes. b) Write the definition of calcCharge method to calculate the transportation charge incurred in sending parcel to its destination based on formula: charge = weight charge + destination charge Weight charge is RM1/kg for parcel less than 10 kg and RM2/kg for heavier parcels. Destination charge is RM5 for destination A, RM10 for destination B and RM15 for destination C. c) Write an application to create 10 Parcel objects(Array Object). Input and display all the information for object Parcels. Display the total transportation charges of all parcels

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!