IF statements etc.

First program:

You must write a program that creates a sequential file that you will use in the second program. Your form should allow the user to input the information that will be written to the file to create a record on the file. You should create about a dozen different records. Analyze the specifications for the second program and create the data so that at least one record will meet the different criteria. For example, some records should have the on hand + on order less than the reorder point and some should have on hand + on order greater than the reorder point etc.

The file should have the following layout:

• Item Number
• Item Name
• Category (A, B, C)
• On Hand
• On Order
• Reorder Point

Second program:

This program must contain a procedure and a function. You can decide what code to put in the procedure and what code to put in the function after analyzing the criteria for the program.

The program should include a message box if category is other than A, B, or C or if on hand, on order or reorder point are not numeric.

This program should read a record and display the information from the record on the form. There should be an additional field that will show the number to be ordered as a result of the calculation.

When the calculate button is pressed, the calculation should be done according to the criteria below. If there are items to be ordered, the number should show in the additional field on the form.

Processing specifications based on a calculate button: Note the questions about category B should be handled together in the sense that there should be only one IF that asks if category is B.

• If category is A and the on hand + the on order is less than the reorder point then you want to order enough items to put on hand + on order 20% higher than the reorder point
• If category is B and the on hand + the on order is less than the reorder point AND on hand is less than half of the reorder point then you want to order enough to put on hand equal to the reorder point.
• If category is B and the on hand + the on order is less than the reorder point AND on hand is NOT less than half the reorder point then you want to order enough to put on hand + on order 25% higher than the reorder point.
• If category is C and the on hand + on order is less than the reorder point, than order to put the on hand + on order 10% higher than the reorder point

EXTRA CREDIT:

• Include a button that will print out the order
• Write a new output file that contains all records. If it has been determined that an order should be placed then the on order field on the new file should be the sum of the on order field on the old file plus the amount that was ordered.