Professional Documents
Culture Documents
CE480UY-Computer Studies 4B Final Exam - 2023
CE480UY-Computer Studies 4B Final Exam - 2023
NAMIBIA
CE480UY
COMPUTER STUDIES 4B
FINAL EXAMINATION
NOVEMBER 2022
Instructions to Candidates:
1
Section A - Answer all Questions [Total Marks: 70]
Create a folder on the desktop and name it CE42022-“Your Surname”
All files for this exam should be saved in this folder.
Question 1
You have been called for a programming position interview by a local IT consultant
company. You are required to design a multiplication calculator consisting of two
textboxes, three labels and three buttons. The two textboxes are for the user to enter
two numbers, one label is to display the multiplication operator, the other label is to
display the equal sign and the last label is to display the answer. The three buttons
represent Calculate, Clear and Exit.
(i) Design a form and provide the code for the ‘calculate’, ‘clear’ and ‘exit’
buttons.
[Total 20 marks]
Question 2
2
[Total 25 Marks]
Question 3
Create a program called Payroll Master. The program should prompt the user to
enter the name of an employee and the number of hours an employee has worked
per week. A week has a total of 40 working hours and any extra hours worked
should be counted as overtime. Normal working hours are paid at N$15.00 per hour
while overtime hours are paid at N$20.00 per hour. The pay per hour for normal
working hours (N$15.00) and for overtime hours (N$20.00) should be stored into
constants and should not be entered by the user. The program should contain a
function called calculatePay with two parameters for employee name and hours
worked. This function uses the number of hours an employee has worked to
calculate the weekly wage of the employee and thereafter display the name of the
employee, and the weekly wage amount in a Message Box.
3
[Total 25 Marks]
Section B – Chose one Question [Total Marks: 30]
Question 4
a) Discuss the importance of “Hierarchy of Operations” (usually referred to as
“Order of Precedence”) and order the following accordingly: addition,
parentheses, raising to a power and multiplication. (5 marks)
b) Calculate the values of Y1, Y2, Y3, Y4 and Y5 in the statements below, taking
the variables K = 3, L = 4, M = 12, N = 20, O= 2 and P = 3. Show all your
calculations.
(i) Y1 = K + L * M - N / O+ P
(ii) Y2 = (K + L) * M - N/ O + P
(iii) Y3 = (K + L) * (M - N) / O + P
(iv) Y4 = (K + L) * (M - N) / (O + P)
c) With examples distinguish between each of the following pairs of terms used
in Visual Basic:
(5 marks each)
[Total 30 marks]
Question 5
a) Many high level languages allow the programmer to use built-in functions and
to create user-defined functions, often with arguments (parameters).
4
b) Examine this piece of Visual Basic
c) With examples distinguish between each of the following pairs of terms used
in Visual Basic:
(i) Constant and Variable
(ii) Numeric Type and String Type. (5 marks each)
[Total 30 marks]