CIVN2014A Project Part A
SCHOOL OF CIVIL AND ENVIRONMENTAL ENGINEERING, WITS
CIVN 2014A (ENGINEERING COMPUTING) 2021 PROGRAMMING PROJECT
This project (20% of the Assignment mark) synthesizes most of what has been learned in programming (e.g. algorithms, programming structures, variables, operators, functions, subroutines, comments, arrays, input, output and VBA).
Instructions:
- Expected individual effort = 15 hours;
- Submit a 1 page (MAXIMUM) summary algorithm of your project (pdf, jpeg) on the Ulwazi – CIVN2014A - Project Part A
- Submit 1 Microsoft Excel Macro-Enabled file containing your worksheets and VBA code on the Ulwazi – CIVN2014A - Project Part B link by 08h00 on Monday, 14 June 2021;
- All late submissions would be docked 10% for each day of lateness until the fifth day. After five days, no marks will be allocated for the submission;
- Individuals may consult one another but are forbidden from producing VBA code together and/or copying (or adapting) one another’s code. Penalty for cheating or submitting similar code = minus 50% to minus 100% of mark obtained.
Task:
Design a 1 page (maximum) algorithm (Project Part A) (pdf, jpeg) and Microsoft Excel Macro-Enabled file of the Vending Machine described below (Project Part B). The Microsoft Excel Macro-Enabled file containing worksheets and VBA code would dispense products (Table 1) whose prices are specified in Table 2.
Table 1. Products and product codes
1 |
2 |
3 |
4 | |
1 |
Simba cheese and onion Product code: 11 |
Simba Nik Naks Product code: 12 |
Fritos corn chips Product code: 13 |
Lays Product code: 14 |
2 |
Doritos Product code: 21 |
Eet sum mor Product code: 22 |
Diddle Daddle Product code: 23 |
Oreo Product code: 24 |
3 |
Snickers Product code: 31 |
Bar One Product code: 32 |
Kit Kat Product code: 33 |
Lunch Bar Product code: 34 |
4 |
Coca-Cola Product code: 41 |
BonAqua Product code: 42 |
Fanta Grape Product code: 43 |
Twist Product code: 44 |
Table 2. Prices
1 |
2 |
3 |
4 | |
1 |
R 10.00 |
R 10.00 |
R 10.00 |
R 10.00 |
2 |
R 10.00 |
R 5.00 |
R 5.00 |
R 10.00 |
3 |
R 10.00 |
R 10.00 |
R 10.00 |
R 10.00 |
4 |
R 15.00 |
R 10.00 |
R 15.00 |
R 15.00 |
Project Part A [Total = 5 marks]
Project Part B [Total= 15 marks]
- Structure of VBA code [1 mark]
- Use of comments [1 mark]
- Innovative and user-friendly [1 mark]
Your developed VBA code would undertake the following tasks after the customer clicks the ‘Purchase a product’ button located on the customer’s worksheet:
- Worksheet for the Customer:
- Receive the customer’s selected product code. Confirm and display the customer’s selected product and the price of the product.
- Receive the customer’s money, which may be input in one or more of the denominations shown in Table 3. The vending machine will only accept the following denominations: R20, R10, R5, R2 and
R1
- Flag any input error.
[i + ii + iii = 3 marks]
iv. Flag any processing error.
- Inform the customer if the selected product is unavailable. If unavailable, another product may be selected.
- Inform the customer if money change for the selected product is unavailable. If unavailable, another product may be selected.
- Monies accepted for purchases will not be added to the monies allocated for change.
- Prevent (and inform) the customer from receiving a product if the total of the monies input by the customer is less than the selected product price.
- Dispense the selected product without change if the total of the monies input by the customer is equal to the product price OR dispense the product with the correct change in specified denominations should the total of the monies input by the customer be more than the product price.
[iv + vi + vii + viii+ ix = 6 marks]
b. Worksheet for the Owner of the vending machine: [x + xi + xii = 3 marks]
- After each transaction, calculate and display the change in the different monetary denominations remaining in the machine.
- After each transaction, calculate and display the quantity of each product remaining in the machine.
- Include a button on this worksheet that permits refreshing. Immediately after refreshing, there are 10 number of each product within the vending machine. Also, immediately after refreshing, the vending machine has the following quantities of each monetary denomination allocated for change (Table 3).
Table 3. Monies allocated for change in the vending machine immediately after refreshing
Denomination |
R20 |
R 10.00 |
R 5.00 |
R 2.00 |
R 1.00 |
Total number |
50 |
50 |
50 |
75 |
100 |