ICG511S - INTRODUCTION TO COMPUTING - 2ND OPP - JULY 2022


ICG511S - INTRODUCTION TO COMPUTING - 2ND OPP - JULY 2022



1 Page 1

▲back to top


n Am I BI A u n IVER s ITY
OF SCIEnCE Ano TECHn
FACULTY OF COMPUTING AND INFORMATICS
DEPARTMENTOF COMPUTERSCIENCE
QUALIFICATION: BACHELOR OF COMPUTER SCIENCE, BACHELOR OF INFORMATICS
QUALIFICATION CODE: 07BCMS, 07BAIT
LEVEL: 5
COURSE: INTRODUCTION TO COMPUTING
COURSE CODE: ICG511S
DATE: JULY 2022
PAPER: THEORY
DURATION: 2 HOURS
MARKS: 60
SECOND OPPORTUNITY/ SUPPLEMENTARY EXAMINATION QUESTION PAPER
EXAMINER(S)
MODERATOR:
Ms N. NASHANDI
Mr S. TJIRASO
Mr S. MUCHINENYIKA
Ms R. IIPINGE
Mr R. MUSUTUA
Mr H. KAVIMAKA
Mr P. GALLERT
INSTRUCTIONS
1. Answer ALL the questions.
2. Read all the questions carefully before answering.
3. Number the answers clearly
THIS QUESTION PAPER CONSISTS OF 7 PAGES
(Including this front page)

2 Page 2

▲back to top


SECTION A Multiple choices and True And false Questions [10 Marks]
Answer all the questions in the provided booklet.
The section consists of 10 questions.
1. What is the output of the following statement?
Print 7*(-9/3)+3
A.
69
B.
24
C.
-18
D.
7
2.
The following formula is used to calculate the area of the circle.
If your program begins with the following code fragment;
r=4, n=3.14, area=0
Which lines of code will successfully calculate the area of the circle?
A.
area =n:+(r *r)
B.
area=(n: * r)2
C.
A=n: r2
D.
area =(r *r)*n:
3.
Which one of the following is NOT a valid variable name?
A.
studentCasing
B.
@studentName
C.
_studentName
D.
student_name
4.
___
application.
is a set of actions executed to verify a particular feature or functionality of your software
A.
Software bugs
B.
Test cases
C.
Vulnerability
D.
Functional requirements
2

3 Page 3

▲back to top


5.
Mr. Amadhila owns a Gym and wants you to implement for him a program to calculate
membership fees based on the flowchart below.
Is gyMembershlp atleast 5 Years?
YES
l
get 50 Namibia ·1
r Dollars Discount
'··-----
NO
l. get 20 Namibia
-~ars Discount
You must implement the logic depicted in the flowchart.
payableAmount.
Use the variables, gyMembership,
Which one of the code snippets below correctly implements the logic in the flowchart?
A. if (gyMembership = 5)
payableAmount=payableAmount
else
payableAmount=payableAmount
- 50
- 20
B. if (gyMembership 5)
payableAmount=payableAmount - 50
else
payableAmount=payableAmount - 20 Abstraction
C. if (gyMembership > 5)
payableAmount=payableAmount - 50
else
payableAmount=payableAmount- 20
D. if (gyMembership 5)
payableAmount=payableAmount - 20
else
payableAmount=payableAmount - 50
3

4 Page 4

▲back to top


6.
What does the following expression evaluate to?
firstNumber=3, secondNumber=l
If ((NOT(firstNumber == secondNumber)) AND firstNumber > secondNumber)
A.
True
B.
False
7.
Loose cohesion is recommended for a good program design.
A.
True
B.
False
8.
A nested if statement cannot always be replaced with a logical operator.
A.
True
B.
False
9.
Encryption is one of the security concepts
A.
True
B.
False
10. Boolean values can be enclosed in double quotes or" "
A.
True
B.
False
4

5 Page 5

▲back to top


SECTION B Structured Questions [50 Marks]
Answer all the questions in the provided booklet.
The section consists of 5 questions.
1.
Given the following problem:
A user wants to divide first number by the second number and print the result to the screen.
NOTE: division by Zero is not allowed (second number should not be zero (0))
a.
Identify the inputs, process and outputs [5 Marks]
b.
Further create a flowchart for the above-mentioned problem (Section B, Question 1(a)). [10
marks]
2.
A programmer for Aisha Beauty Salon is developing a program to calculate discount pricing for
bulk beauty product orders. Write an algorithm in pseudocode that calculates and displays the cost price
of beauty products after deduction of discount using this pricing table. The program prints "no discount"
for any other item quantity not specified in the pricing table. [10 Marks].
Item quantity range Discount
10-49
10%
50-99
15%
100-199
17%
200 or More
20%
5

6 Page 6

▲back to top


3.
Given the following flowchart, convert it into the equivalent pseudocode. [5 marks]
number is negative
No
number is not negative
4.
Given the following pseudocode, convert the linear if statement into a case structure. [10 Marks]
Start
Prompt the user for dayOfrheWeek
Get dayOfrheWeek
if(dayOfrheWeek = =1)
display "Monday!"
else if (dayOfrheWeek = =2)
display" Tuesday!"
else if (dayOfrheWeek = =3)
display" Wednesday!"
else if (dayOfrheWeek = =4)
display" Thursday!"
else if (dayOfrheWeek = =5)
display "Friday!"
else if (dayOfrheWeek = =6)
display "Saturday!"
else if (dayOfrheWeek = =7)
display "Sunday!"
else
display " Invalid Day of the week!"
endif
endif
endif
endif
endif
endif
end
6

7 Page 7

▲back to top


5.
Create a pseudocode that will ask for the age of all students in your tutorial group and store it in
an array, age[]. The program should then print the age of the oldest student in the group. Assume that
your tutorial group consists of 50 students. [10 Marks]
**************************** End of the Paper***********************************
7