1. A shipping company charges the rates listed in the following table: Shipping Rate per Mile Weight of package in kg 2 kg or less $0.01 $0.015 $0.02 $0.025 Over 2 kg, but not more than 6 kg Over 6 kg, but not more than 10 kg Over 10 kg, but not more than 20 kg Create an application that allows the user to enter the weight of the package and the distance it is to be shipped, and then displays the charges in a label. Ensure that the user has entered valid numbers. Do not accept values of 0 or less for the weight of the package. Do not accept weights of more than 20 kg (this is the maximum weight the company will ship). Do not accept distances of less than 10 miles or more than 3000 miles. These are the company's minimum and maximum shipping distances. Suggestion: Use the || operator to combine the two range conditions that check for package weights that are too small or too large. I suggest you go about this problem by first making sure everything is valid. And if everything is valid, do what the application asks you to do. Test with the following data: Weight and Distance 1.5 kg, 100 miles 5 kg, 200 miles 8kg, 750 miles 15 kg, 2000 miles Also test your validation Shipping Cost $ 1.00 $ 3.00 $ 15.00 $ 50.00

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter4: The Selection Structure
Section: Chapter Questions
Problem 5E
icon
Related questions
Question

c# code with forms

1. A shipping company charges the rates listed in the following table:
Weight of package in kg
2 kg or less
Over 2 kg, but not more than 6 kg
Over 6 kg, but not more than 10 kg
Over 10 kg, but not more than 20 kg
Shipping Rate per Mile
$0.01
$0.015
$0.02
$0.025
Create an application that allows the user to enter the weight of the package and the distance it
is to be shipped, and then displays the charges in a label. Ensure that the user has entered valid
numbers. Do not accept values of 0 or less for the weight of the package. Do not accept weights
of more than 20 kg (this is the maximum weight the company will ship). Do not accept
distances of less than 10 miles or more than 3000 miles. These are the company's minimum and
maximum shipping distances. Suggestion: Use the || operator to combine the two range
conditions that check for package weights that are too small or too large. I suggest you go about
this problem by first making sure everything is valid. And if everything is valid, do what the
application asks you to do.
Test with the following data:
Weight and Distance
1.5 kg, 100 miles
5 kg, 200 miles
8kg, 750 miles
15 kg, 2000 miles
Also test your validation
Shipping Cost
$ 1.00
$ 3.00
$ 15.00
$
50.00
Transcribed Image Text:1. A shipping company charges the rates listed in the following table: Weight of package in kg 2 kg or less Over 2 kg, but not more than 6 kg Over 6 kg, but not more than 10 kg Over 10 kg, but not more than 20 kg Shipping Rate per Mile $0.01 $0.015 $0.02 $0.025 Create an application that allows the user to enter the weight of the package and the distance it is to be shipped, and then displays the charges in a label. Ensure that the user has entered valid numbers. Do not accept values of 0 or less for the weight of the package. Do not accept weights of more than 20 kg (this is the maximum weight the company will ship). Do not accept distances of less than 10 miles or more than 3000 miles. These are the company's minimum and maximum shipping distances. Suggestion: Use the || operator to combine the two range conditions that check for package weights that are too small or too large. I suggest you go about this problem by first making sure everything is valid. And if everything is valid, do what the application asks you to do. Test with the following data: Weight and Distance 1.5 kg, 100 miles 5 kg, 200 miles 8kg, 750 miles 15 kg, 2000 miles Also test your validation Shipping Cost $ 1.00 $ 3.00 $ 15.00 $ 50.00
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Returning value from Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,