ICG511S - INTRODUCTION TO COMPUTING - 1ST OPP - JUNE 2023


ICG511S - INTRODUCTION TO COMPUTING - 1ST OPP - JUNE 2023



1 Page 1

▲back to top


nAmlBIA unlVERSITY
OF SCIEnCE Ano TECHnOLOGY
FACULTY OF COMPUTING AND INFORMATICS
DEPARTMENTOF SOFTWAREENGINEERING
QUALIFICATION: BACHELOROF COMPUTERSCIENCE,BACHELOROF INFORMATICS
QUALIFICATION CODE: 07BCMS, 07BAIT
LEVEL:5
COURSE:INTRODUCTIONTO COMPUTING
COURSECODE: ICGSllS
DATE:JUNE 2023
PAPER:THEORY
DURATION: 3 HRS
MARKS: 75
EXAMINER(S)
FIRSTOPPORTUNITY EXAMINATION QUESTION PAPER
Ms. NDINELAGO NASHANDI
MODERATOR:
Mr. PETERGALLERT
THIS QUESTION PAPERCONSISTSOF 7 PAGES
(Including this front page)

2 Page 2

▲back to top


INSTRUCTIONS TO STUDENTS:
1. Read all the questions, passages, scenarios, etc., carefully before answering.
2. Answer all the questions.
3. Number each answer clearly and correctly.
4. Write neatly and legibly.
5. Making use of any crib notes may lead to disqualification and disciplinary action.
6. Use the allocated marks as a guideline when answering questions.
7. Looking at other students' work is strictly prohibited.
8. This paper consists of seven (7) pages including the cover page.
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. Select the correct answer for the algorithm displayed below.
functionl(number){
total= number+ 25
return total
}
Start
Display function1(7)
end
A. 25
B. Error
C. 32
D. 7
2. Syntax of accessing the first element with the array a:
A. A[O]
B. A{O}
C. A(l)
D. A[1]
Page 2 of 7

3 Page 3

▲back to top


3. Which data type is used to store the following value: '5'
A. integer
B. string
C. numbers
D. character
4. Select the correct function call of function personal() given below.
personal(name, age){
display (name, age)
}
A. personal("Anna", 16)
B. personal(16,"Selma")
C. personal(age=16, name=" Anna")
D. personal()
5. Local variables are defined in?
A. Functions
B. If statement
C. On top of the pseudocode
D. In the loop
6. In a flowchart, the input and output are represented by __ ?
A. diamond
B. Rectangle
C. Parallelogram
D. A circle
7. What does the following expression evaluate to,
x=30,y=8
if(NOT( x<y ))
A. True
B. False
Page 3 of 7

4 Page 4

▲back to top


8. While comparing two variables, their datatypes / format should be the same.
A. True
B. False
9. x = x +1 and x+=l and x++ all accomplish increment
A. True
B. False
10. Sequential, selection and iterative control are all based on a given condition.
A. True
B. False
Page 4 of 7

5 Page 5

▲back to top


SECTION B: Structured Questions [65 Marks]
l.
Convert the following if statement into a nested if statement: [3 marks]
If (age>=18} and (citizenship==" Namibian"} THEN
Display "you are eligible to vote"
End if
2.
Identify the inputs, process and outputs for a pseudo code that should calculate a
running sum. A user will enter numbers that will be added to the sum and when a
negative number is encountered, stop adding numbers and write out the result [4
Marks]
3.
Rewrite the following pseudocode by replacing the case structure with a linear if
statement: [ 6 Marks]
·
start
Prompt the user for grade.
Get grade.
case of (grade}
"A": display "Excellent!"
"B": display" Very Good!"
"C": display" Well done!"
"D": display" You Passed!"
"F": display "Better try again!"
Default: display" Invalid Grade!"
End Case
End
Page 5 of 7

6 Page 6

▲back to top


4.
Convert the following pseudo code into a flowchart:
Start
i=O
Do
Prompt user for a number
get num
if(num!=O}then
if(num>O}then
display "number is positive"
else
display "number is negative"
else display "number is zero"
i=i+l
while(i<lOO}
end While
END
[10 Marks]
5.
Write a pseudo code that get a mark for the ICGtest for each student and print out
the grade and grade description according to the table below
[20 marks]
Marks
Grade
Grade Description
80 - 100
70 - 79
60 - 69
50 - 59
0-49
A
Distinction
B
Very Good
C
Good
D
Satisfactory
F
Failed
Page 6 of7

7 Page 7

▲back to top


6. Write a pseudo code that read an array of integers and print out how many times a given
element exists in it. [9 Marks]
7. Create a function named oddNumbers() that takes in array of integers and return sum of all
the odd numbers within the array. Provide a function call as well. [13 marks]
************ End of the Paper***************
Page 7 of7