Very Busy (VB) Mail Order
Do the housekeeping required to setup your project.
This includes:
- Creating a New Project Directory
- Saving the Form
- Saving the Project File
Specifications
Calculate the amount due for the order based on the cost of the item and the shipping and handling charges.
Shipping is $0.25 per pound and the Handling Charges are listed below in the table
Less than 10 pounds | $1.00 |
10 to 100 pounds | $3.00 |
Over 100 pounds | $5.00 |
You must edit the input and issue an error message if the input is missing or invalid. You must also maintain the totals for product and weight so that the summary totals can be calculated.
User Interface
Use the frame controls to separate the related controls and as always, code the proper tab sequence and keyboard interface
The coding is detailed below for the Next Item (Calculate) Button and the Update Summary events and the Module Level variables.
Two Module Level Variables are needed for the Summary Update
Dim msngAmountDueTotal As Single
Dim msngWeightTotal As Single
Calculate Logic
Define the Local Variables for the cmdNext_Click event.
Edit Logic: Make sure that the three controls used in the calculations are present and their contents are numeric. Coding here involves exiting the procedure with an error message as soon as an error is detected. This example contains what is sometimes refered to as a "Null Then Clause". This eliminates the need for "Negative Logic" or acting when a condition is not true.
When all the input is correct, perform the calculations and reset the form
Summary Logic
Declare the local variables
Perform the calculations using the Module Level Variables
Display the results on the form
Test the program using test data for which you know what the results should be.
Just because you get results does not mean that the results are correct
See the test data tables and results on Page 165 in the text.
A couple of things to double check:
This completes the lab