Sei sulla pagina 1di 9

IE 212: Computational Methods for Industrial Engineering

Summer 2015
Term Project
Due Date: Thursday, August 13th, 2015 @ 1:00pm

The term project is worth a maximum of 255 points. The first evaluation of your Excel VBA solution will assess
how well it works. Based on this criterion, points will be awarded based on the following scale:

45 points Excellent (everything works; solution produces valid and consistent results).
35 points Good (graphical user interface is good; solution produces inconsistent results).
25 points Bad (graphical user interface is poor; solution produces invalid results).

An additional 210 points may be awarded based on how well you meet the requirements specified in this
document.

MAIN DELIVERABLES

DELIVERABLE ONE

Prepare a document in Microsoft (MS) Word that includes the following components of your term project in the
specific order listed and in separate pages (double-sided printing is NOT acceptable):

- (5 pts) Cover sheet (see the last page of this document). Your name must be added electronically to this
page.
- (5 pts) A program plan. The program plan must be developed electronically in MS Visio. An example of a
program plan is available on the course's web site under the link to the notes for Lecture #5.

You must print a hard copy of the MS Word document, staple it, and submit it at the beginning of the final exam
(Thursday, August 13th, 2015 at 1:00 pm).

DELIVERABLE TWO

You must submit an electronic version of deliverable one (i.e., the MS Word document) via T.E.A.C.H. by
1:00pm on Thursday, August 13th, 2015.

DELIVERABLE THREE

You must submit a single Excel file named as YourLastName_Project.xlsm via T.E.A.C.H. by 1:00pm on
Thursday, August 13th, 2015.

1
PROJECT OBJECTIVE

In partial fulfillment of the requirements of this course, you are required to develop an application for a hardware
store to calculate the total cost for a selection of hardware items ordered by a customer. The hardware store is fairly
new, so the owner has provided limited data and pictures of selected hardware items so that you can test your
proposed Excel VBA solution.

A user will provide individual hardware item numbers and purchase quantities via input boxes. This information,
along with the limited data provide by the hardware store owner, will be used to calculate the total cost.

SOLUTION REQUIREMENTS

Your Excel VBA solution must include three worksheets named Welcome, Order_Items, and Data. The
worksheet Data contains limited information about different hardware items provided by the hardware store
owner, including item number (e.g., S3393), description, and unit price. The worksheet Data must always be
hidden from the user. The specific actions to be performed in worksheets Welcome and Order_Items are
described below.

WORKSHEET Welcome (15 points)


(4 pts) When the Excel workbook first opens, only the worksheet Welcome must be visible to the user.
(4 pts) The worksheet Welcome must display a rectangular shape with a brief explanation of the purpose of
the Excel VBA application.
(4 pts) The worksheet Welcome must not display gridlines. This functionality must be implemented via Excel
VBA code.
(3 pts) The worksheet Welcome must display two rectangular shape buttons labeled "PROCEED" and EXIT
APPLICATION.

Button PROCEED (5 points)


Create a sub procedure named GoAddItemsSheet() and assign it to the button PROCEED. The following
functionality must be provided when the user presses the button PROCEED:
o (3 pts) The worksheet Order_Items must be displayed.
o (2 pts) The worksheet Welcome must be hidden.

Button EXIT APPLICATION (10 points)


Create a sub procedure named CloseApp() and assign it to the button EXIT APPLICATION. The following
functionality must be provided when the user presses the button EXIT APPLICATION:
o (4 pts) Your application must display a message box set up exactly as depicted in Figure 1.
(2 pts) If the user presses the button labeled "Yes", the Excel workbook must be saved and closed.
(2 pts) If the user presses the button labeled "No", the Excel workbook must remain open.
(2 pts) The button labeled No must be setup as the default button of the message box.

Figure 1. Message box displayed if the user presses the button EXIT APPLICATION .

2
WORKSHEET Order_Items (35 points)
The worksheet Order_Items must include the following components:
o (5 pts) A rectangular shape with instructions about how to interact with the four buttons available in this
worksheet.
(1 pts) The rectangular shape must be configured manually to prevent it from shifting when
calculations are performed.
o (8 pts) Four rectangular shape buttons labeled ADD ITEMS, CALCULATE TOTAL, CLEAR
FORM, and WELCOME SHEET.
(4 pts) Rectangular shape buttons must be configured manually so that they do not shift when
calculations are performed.
(2 pts) The rectangular shape button labeled CALCULATE TOTAL must become visible after the
user presses the button labeled ADD ITEMS for the first time.
o (5 pts) Align the upper left corner of each of the rectangular shapes described above with the upper left
corner of the cells shown in Table 1.

Table 1. Cell position of the upper left corners of rectangular shapes displayed in worksheet Order_Items.
Rectangular Shape Cell
Rectangular shape with instructions B2
ADD ITEMS button B10
CALCULATE TOTAL B13
CLEAR FORM B20
WELCOME SHEET B23

(4 pts) The worksheet Order_Items must not display gridlines. This functionality must be implemented via
Excel VBA code.
(3 pts) All data (i.e., inputs, results, and pictures) and data formats must be cleared from the worksheet
Order_Items every time the worksheet Order_Items is accessed from the worksheet "Welcome".
(3 pts) The only objects that must always be visible when the worksheet Order_Items is first displayed or
cleared are:
o The rectangular shape with the instructions, and
o The rectangular shape buttons ADD ITEMS, CLEAR FORM, and WELCOME SHEET.

Button ADD ITEMS (70 points)


Create a sub procedure named AddItems() and assign it to the button ADD ITEMS. The following
functionality must be provided when the user presses the button ADD ITEMS:
o (5 pts) The column headers of the table that will organize the hardware items purchased by the user
must be displayed on the worksheet Order_Items by calling a sub procedure named
PrintItemTableHeader().
(3 pts) A variable of type Range set to cell G12 must be passed to the sub procedure
PrintItemTableHeader() as an argument.
(7 pts) Every column header must have a border around its cell. Labels must be displayed using BOLD
type and be centered. The width of the columns may be set manually.
(5 pts) Table 2 specifies the location and additional formatting required for each column header.

Table 2. Location and formatting of column headers of the hardware items table.
Cell Label
G12 Item #
H12 Description
I12 Qty
J12 Unit Price
K12 Subtotal

3
o (5 pts) The user must be prompted for a valid hardware item number via a single input box configured
exactly as depicted in Figure 2.

Figure 2. Input box to request hardware item number.

o Once the user enters a hardware item number via the input box depicted in Figure 2, the following must
be verified:
(3 pts) The hardware item number:
- Contains exactly five characters.
- Starts with the letter S.
- Ends with four numbers.
(6 pts) If the hardware item number meets with the above conditions, the sub procedure AddItems()
must call a function procedure named checkItemNo() to verify that the hardware item number exists
in the worksheet Data.
- (3 pts) A variable of type String storing the hardware item number must be passed to the function
procedure checkItemNo() as an argument.
(3 pts) If the user enters an invalid hardware item number, presses the button "OK" without entering a
value, or presses the button "Cancel" in the input box, a message box set up exactly as depicted in
Figure 3 must be displayed.

Figure 3. Message box displayed if the user provides incorrect hardware item number.

o (5 pts) If the user enters a valid hardware item number (i.e., format is correct and hardware item
number exists in worksheet Data), the user must be prompted for a purchase quantity via a single
input box configured exactly as depicted in Figure 4.

Figure 4. Input box to request a purchase quantity.

4
o Once the user enters a purchase quantity via the input box depicted in Figure 4, the following must be
verified:
(2 pts) The purchase quantity can represent a number.
(3 pts) If the user enters an invalid purchase quantity, presses the button "OK" without entering a value,
or presses the button "Cancel" in the input box, a message box set up exactly as depicted in Figure 5
must be displayed.

Figure 5. Message box displayed if user provides incorrect purchase quantity.

o Once the user provides a valid hardware item number and a valid purchase quantity, a new row must be
added to the table that will organize the hardware items purchased .
(1 pts) Every cell in the new row must have a border and use standard font style (i.e., not BOLD).
(1 pts) Rows added to the table must alternate their fill color to improve readability.
(1 pts) The cell under the column labeled Item # must display the hardware item number entered by
the user.
(1 pts) The cell under the column labeled Description must display the description corresponding to
the hardware item found in the worksheet Data.
(1 pts) The cell under the column labeled Qty must display the purchase quantity entered by the user.
(1 pts) The cell under the column labeled Unit Price must display the unit price corresponding to the
item found in the worksheet Data.
(2 pts) The cell under the column labeled Subtotal must display the result of the calculation
(Purchase Quantity * Unit Price).
- (2 pts) Each subtotal calculated for a new hardware item must be added to a global, one-
dimensional array named itemsCost.
(5 pts) Table 3 specifies additional formatting required for each cell of a new row.

Table 3. Location and formatting for the cells in the rows of the hardware items table.
Column Alignment Number Format
G Left N/A
H Left N/A
I Centered Integer (no decimal point)
J Centered Two digits after decimal point
Dollar sign ($)
K Right
Two digits after decimal point

o (2 pts) If the user enters a hardware item number that has a picture, this picture must be displayed. The
upper left corner of the picture must be aligned with cell M13.
o (2 pts) If the user enters a hardware item number without a picture, then the picture with the legend No
Picture Available must be displayed.
o (1 pts) The sub procedure AddItems() must end by selecting cell G12.

5
Button CALCULATE TOTAL (15 points)
Create a sub procedure named CalculateTotalCost() and assign it to the button CALCULATE TOTAL. The
following functionality must be provided when the user presses the button CALCULATE TOTAL:
o (10 pts) The total cost of the hardware items purchased by the user must be calculated using the
information stored in the global, one-dimensional array named itemsCost.
o (5 pts) The range J10:K10 must be used to print the label for the total cost and the amount for the total
cost.
Table 4 specifies additional formatting required for each cell in the range J10:K10.

Table 4. Location and formatting for the cells to display total cost.
Cell Alignment Color Fill Label Text Number Format
J10 Right Cyan Total Cost: N/A
Dollar sign ($)
K10 Right Cyan N/A
Two digits after decimal point

Button CLEAR FORM (10 points)


Create a sub procedure named ClearForm() and assign it to the button CLEAR FORM. The following
functionality must be provided when the user presses the button CLEAR FORM:
o (3 pts) All data (i.e., inputs, results, and pictures) and data formats must be cleared from the worksheet
Order_Items.
o (4 pts) The button labeled CALCULATE TOTAL must be hidden.
o (3 pts) The sub procedure ClearForm() must end by selecting cell A1.

Button WELCOME SHEET (10 points)


Create a sub procedure named GoBackWelcome() and assign it to the button WELCOME SHEET. The
following functionality must be provided when the user presses the button WELCOME SHEET.
o (4 pts) The worksheet Welcome must be displayed.
o (4 pts) The worksheet Order_Items must be hidden.
o (2 pts) The sub procedure GoBackWelcome() must end by selecting cell A1.

ADDITIONAL REQUIREMENTS (30 points):

(5 pts) Except for the Excel VBA code needed to enable the functionality required when the Excel workbook
first opens, all other Excel VBA code must be written in a single module (i.e., Module1).
(5 pts) Make sure your program does not experience excessive flickering when processing the input data or
displaying the results.
(12 pts) Make sure to follow good programming practices. In particular, the following will be considered
heavily when grading your term project:
o Explicitly declaring all variables.
o Properly and consistently indenting your code so that it is easier to read.
o Adding extensive comments to your code.
(8 pts) Following is the order in which all sub procedures and function procedures must be listed in the final
version of Module1 (from top to bottom):
o Sub procedure GoAddItemsSheet().
o Sub procedure AddItems().
o Sub procedure PrintItemTableHeader().
o Function procedure checkItemNo().
o Sub procedure CalculateTotalCost().
o Sub procedure ClearForm().
o Sub procedure GoBackWelcome().

6
o Sub procedure CloseApp().

7
-
-
-
-
-
-
-
- IE 212: Computational Methods for Industrial
Engineering
- Term Project
-
-
- Submitted by:
-
- Your Name Goes Here
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Summer 2015

Potrebbero piacerti anche