mbmailasgn08.htm; updated 4/15/2004
VB Mail Assignment 8
The VB Mail Order firm has hired you to create a project that displays the mailing distance between two cities. The project will compute the cost of mailing a package as a function of the distance between cities. The form for the project is shown here.

Requirements.
At Design Mode:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
1004 |
1753 |
2752 |
3017 |
1520 |
1507 |
609 |
3155 |
448 |
|
|
1004 |
0 |
921 |
1780 |
2048 |
1397 |
919 |
515 |
2176 |
709 |
|
|
1753 |
921 |
0 |
1230 |
1399 |
1343 |
517 |
1435 |
2234 |
1307 |
|
|
2752 |
1780 |
1230 |
0 |
272 |
2570 |
1732 |
2251 |
1322 |
2420 |
|
|
3017 |
2048 |
1399 |
272 |
0 |
2716 |
1858 |
2523 |
1278 |
2646 |
|
|
1520 |
1397 |
1343 |
2570 |
2716 |
0 |
860 |
1494 |
3447 |
1057 |
|
|
1507 |
919 |
517 |
1732 |
1858 |
860 |
0 |
1307 |
2734 |
1099 |
|
|
609 |
515 |
1435 |
2251 |
2523 |
1494 |
1307 |
0 |
2820 |
571 |
|
|
3155 |
2176 |
2234 |
1322 |
1278 |
3447 |
2734 |
2820 |
0 |
2887 |
|
|
448 |
709 |
1307 |
2420 |
2646 |
1057 |
1099 |
571 |
2887 |
0 |
|
Miles |
Charge |
|
0 |
No charge |
|
1 to 100 |
$0.075 / mile |
|
101 to 800 |
$0.07 / mile |
|
801 to 1500 |
$0.065 / mile |
|
1501 and over |
$0.06 / mile |
Ø
Example #1:
a package is to be shipped from
o First 100 miles @ 7.5 cents/mile = $7.50
o Next 415 miles @ 7 cents/mile = $29.05
o Total cost of shipment = $7.50 + $29.05 = $36.55
Ø
Example #2:
a package is to be shipped from
o First 100 miles @ 7.5 cents/mile = $7.50
o Next 700 miles @ 7 cents/mile = $49.00
o Next 700 miles @ 6.5 cents/mile = $45.50
o Last 1070 miles @ 6 cents/mile = $64.20
o Total cost of shipment = $7.50 + $49.00 + $45.50 + $64.20 = $166.20
*If you don't feel like entering the data from the table into an array, you can paste it into word by going Edit, then Paste Special, and choosing unformatted text, then copying each line into VB, and adjusting the entries into your array.
*A group of If/Then statements will work. If the array is called "distance", then it might look like this:
If distance > 100 And distance < 801 Then
txtPrice.Text = 100 * 0.075
distance = distance - 100
txtPrice.Text = FormatCurrency(txtPrice.Text + (distance * 0.07))
Exit Sub
End IfIf distance > 800 And distance < 1501 Then
txtPrice.Text = 100 * 0.075
distance = distance - 100
txtPrice.Text = txtPrice.Text + (700 * 0.07)
distance = distance - 700
txtPrice.Text = FormatCurrency(txtPrice.Text + (distance * 0.065))
Exit Sub
End If
This is only part of the code (above) you would need to finish for greater than 1500.
On Startup:
During Execution:
Assessment of Project. Your
work will be evaluated in terms of major and minor errors. The point deductions are explained
below. An assessment (test) plan is provided
that lists the different types of errors.
Test Data.
You must produce
test data to test all possible combinations of distance charges.
Test Plan. This test plan lists the various
errors that can occur. Major errors are
indicated by two asterisks **.
Visual Basic Project Assessment Plan -
VB Mail Order Assignment 8
Student:_________________________________________________________Possible
Points: 20
Before startup.
Startup.
Distance & Charge button.
Clear button.
Exit button. Fails to exit the system.
During program execution, the
program abnormally terminated (ABEND) due to an error (** -- major error
– specify the error):