Skip to content

Q1

Q.1 An on-line retailer charge for delivery as follows:

  • Orders below €100.00 - €8.99 delivery charge
  • Orders between €100.00 - €199.99 - €3.99 delivery charge
  • Orders of €200.00 - €10000.00 – Free delivery

Write and test a class called DeliveryCharge.java that takes the amount of the order as input and returns the delivery charge based on the information above.

The maximum order accepted online is €10000.00. Handle unexpected values with IllegalArgumentException.

Using equivalence partitioning and boundary value analysis identify the equivalence partitions and boundary values (using 3-value analysis) that you would explore for this scenario. Write the values into the sheets provided and write the code for DeliveryCharge.java and DeliveryChargeTest.java.

+ com.ait.delivery  
  > DeliveryCharge.java  
  > DeliveryChargeTest.java
public double calculateCharge(double orderAmount) {