Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a delivery class for a delivery service. The class contains fields to hol

ID: 3647472 • Letter: C

Question

Create a delivery class for a delivery service. The class contains fields to hold the following:

1. A deliver number that contains 8 digits. the first four digits represent the year, and the last four digits represent the delivery number. For ex, the 76th delivery in 2011 has a complete delivery number of 20110076.

2. A code representing the delivery area. A local delivery is code 1, and a long distance delivery is a code 2.

3. A weight, in pounds, of the item to be delivered,

4. The fee for the delivery, as follows:

Distance Weight Fee($)
1 Under 5 Pounds 12.00
1 5 - 20 lbs 16.50
1 Over 20 lbs 22.00
2 Under 5 lbs 35.00
2 5 lbs or more 47.95

Explanation / Answer

public class DeliveryService { int deliveryYear; int deliveryNo; int completeDeliveryNo; int distanceCode; double weight; double fees; void setDeliveryNo(int deliveryYear, int deliveryNo) { String str; if (deliveryNo = 10 && deliveryNo = 100 && deliveryNo = 5 && weight 20) { fees = 22; } } else if (distanceCode == 2) { if (weight < 5) { fees = 35; } else if (weight >= 5 && weight
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote