design for your business the Shipping Charges Calculator
your company charges the rates listed in the following table:
Weight of Package in Kilograms Shipping Rate per Mile
2 kg or less $0.01
Over 2 kg, but not more than 6 kg $0.015
Over 6 kg, but not more than 10 kg $0.02
Over 10 kg, but not more than 20 kg $0.025
Design an application that allows the user to enter the package weight and the distance to be shipped, and then displays the charges.
Input validation:
Do not accept values of 0 or less for the package weight
Do not accept values greater than 20 kg (this is the maximum weight your company will ship)
Do not accept distances less than 10 or greater than 3,000 miles. These are the company minimum and maximum shipping distances.
Use the OrElse operator to combine the two range conditions that check for package weights that are too small or too large.
Use exception handling and / or error handling to check for non-numeric data.