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 $[url removed, login to view]
Over 2 kg, but not more than 6 kg $[url removed, login to view]
Over 6 kg, but not more than 10 kg $[url removed, login to view]
Over 10 kg, but not more than 20 kg $[url removed, login to view]
Design an application that allows the user to enter the package weight and the distance to be shipped, and then displays the charges.
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.