Assignment No. 7

User Defined Procedures

Order Status

 

The Middletown Wire Company sells spools of copper wiring for $100 each. The normal deliver charge is $10 per spool.  Rush delivery costs $15 per spool.  Create an application that displays the status of an order.  The status should include the following:

·         The number of spools ready to ship.

·         The number of spools on back order.

·         The shipping and handling charges.

·         The total amount due.

The application’s form should resemble the one below:

 

The user should enter the number of spools ordered into the text box, and check the Rush Delivery check box if rush delivery is desired.  When the Calculate Total button is clicked, an input box should appear asking the user to enter the number of spools currently in stock.  If the user has ordered more spools than are in stock, a portion of the order is back-ordered.  For example, if the user orders 200 spools and there are only 150 spools in stock, then 150 spools are ready to ship and 50 spools are back-ordered.


 

The application should have the following functions, called from the Calculate Total button’s Click event procedure:

GetInStock              Displays an input box asking the user to enter the number of spools in stock.  The function should return the value entered by the user.

ReadyToShip            Accepts the following arguments: the number of spools in stock and the number of spools ordered.  The function returns the number of spools ready to ship.

BackOrdered            Accepts the following arguments: the number of spools in stock and the number of spools ordered.  The function returns the number of spools on back order.  If no spools are on back order, it returns 0.

ShippingCharges   Accepts the following arguments: the number of spools ready to ship and the per-spool shipping charges.  The function returns the total shipping and handling charges.

 

The application should have the following procedures, called from the Clear Form button’s Click event procedure:

ResetSpools            Clears the text box and the check box.

ResetDelivery        Clears the labels that display the delivery information.

 

Input Validation: Do not accept orders for less than one spool.

 

Compress the solution folder that you have created into a Zip file and upload into Canvas.