Assignment 3
Assignment 3
INTRODUCTION
In this assignment, you will be creating a small system that a costume rental company can use. Costumes-
R-Us rents out different types of clown costumes. The system will allow a person to pick a clown costume
to rent. The total rental fee will be calculated by considering the following:
• The type of clown costume that was rented;
• The number of days that the clown costume was rented;
• If the clown costume had to be delivered to the customer;
• If the clown costume was damaged.
QUESTION 1
Create a new Excel workbook and save it as an Excel Macro-Enabled Workbook (*.xlsm). Select this option
from the Save as type drop-down list in the Save As window. The filename should be
A3_Studentnumber_Initials_Surname.xlsm (e.g. A3_123456_W_Nel.xlsm). When working in the
computer labs, ensure that you save your work on your Flash Drive. Save at least every 5 minutes.
QUESTION 2 [4 MARKS]
Recreate the content of the figure below. Ensure that the content is in the correct cells. Add the AutoSum
Function to B18, which will sum B15:B17. Change the number format of B15:B18 to Currency.
1 of 5 UFS
Assignment 3 CSIS1683
QUESTION 3
Create a code module named SelectCostume. Write the code for questions 3.1 – 3.4 in this code module.
[1 MARK]
• The options A, B and C must be read from the cells E2:E4 and then displayed to the user as part
of the prompt. Declare three variables (the options), assign the values E2:E4 to them, and then
use them as part of the prompt for the user.
• The user’s input must be converted to uppercase when the OK button is clicked, and then it
should assigned to a variable.
• The user’s input must be checked by comparing the declared variables (A, B and C) with the
user’s input (make use of an If…Then…Else). When the user enters either an A, B or C, the
following should happen:
o The value that the user entered must be displayed in B2.
o The CostumeDescription Sub Procedure must be called (see Question 3.2).
o The RentalDetails Sub Procedure must be called (see Question 3.3).
o The CostumeConditionBefore Sub Procedure must be called (see Question 3.4).
2 of 5 UFS
Assignment 3 CSIS1683
When the user enters any other value, the following Message box must be displayed, and once
the OK button is clicked, the code execution should stop:
• Add a button on the worksheet named “Estimation” that will call this Sub Procedure when
clicked. Refer to the example image at the end.
3 of 5 UFS
Assignment 3 CSIS1683
The value “3” in the prompt should not be hardcoded but rather be calculated by counting the
number of costume conditions in E7:E9. Use the CountA function. Refer to
https://www.automateexcel.com/vba/vba-count/ for an example. Note: The user will enter the
numbers 1, 2 or 3.
QUESTION 4
Create a code module named ReturnCostume. Write the code for questions 4.1 and 4.2 in this code
module. [1 MARK]
• This Sub Procedure should call the Estimation Sub Procedure (see Question 4.2).
• Add the Smiley Face (colour it yellow) to the WorkSheet, which will call this Sub Procedure when
clicked. Refer to the example image at the end.
QUESTION 5
Create a code module named AllCalculations. Write the code for questions 5.1 - 5.3 in this code module.
[1 MARK]
4 of 5 UFS
Assignment 3 CSIS1683
EXAMPLE
SUBMISSION
ONLY the last submission on Blackboard will be marked.
DUE DATE: 12 September 2024 before 20:00 submitted on Blackboard.
5 of 5 UFS