Lab for Week 4 - Step by Step

 

Very Busy (VB) Mail Order

 

Do the housekeeping required to setup your project.

This includes:


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

Lab 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.

Define Local Variables

 

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.

Edits

 

When all the input is correct, perform the calculations and reset the form

Calculate

 

Summary Logic

Declare the local variables

Defife the Local Variables

Perform the calculations using the Module Level Variables

LabSumCalc.jpg (28281 bytes)

Display the results on the form

LabSumShow.jpg (14096 bytes)

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

Back to Week 4