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


ICG511S - INTRODUCTION TO COMPUTING - 2ND OPP - JULY 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: INTRODUCTION TO COMPUTING
COURSE CODE: ICG511S
DATE: JULY 2023
PAPER: THEORY
DURATION: 3 HRS
MARKS: 75
SUPPLEMENTARY/ SECOND OPPORTUNITY EXAMINATION QUESTION PAPER
EXAMINER(S)
Ms. NDINELAGO NASHANDI
MODERATOR:
Mr. PETERGALLERT
THIS QUESTION PAPER CONSISTS OF 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 six (6) 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. 1 == 1 OR 2 != 1 evaluate to:
A. True
B. False
2. Given the following pseudocode what will be the output:
X=10
If {x>7) then
Display "Inside the if"
Else
Display "Inside the else"
End if
Display "All done"
A. Inside the if
Inside the else
All done
B. Inside the if
All done
C. Inside the else
All done
D. Inside the if
E. All done
Page 1 of 6

3 Page 3

▲back to top


3. To repeat a task several times we use
A.
Input statement
B.
If statement
C.
Loop statement
D. Output statement
4.
Which one of the following is a valid assignment statement?
A. salary==200
B. isEmpty=true
C. "John"=studentName
D. Name=John
E. None of the above
5. Pseudocode is a _____
representation of algorithms.
A. Graphical
B. Textual
C. Verbal
D. Visual
6. What does the following expression evaluate to;
firstNumber=4, secondNumber=6
If{ {NOT{firstNumber == second Number)) AND firstNumber > secondNumber)
A. True
B. False
7. A DO WHILE Loop performs at least one an iteration before testing its condition.
A. True
B. False
8.
A loop that is inside another loop is called a multidimensional loop
A. True
B. False
9.
Parameter is a data that you pass to the function during a function call.
A. True
B. False
10. Statements in function definition can be executed without a function call.
A. True
B. False
Page 2 of 6

4 Page 4

▲back to top


SECTION B: Structured Questions f65 Marks)
Answer all the questions in the provided booklet.
The section. consists of 7 questions.
1.
Create an employee record "employee" to store the following details of an employee
name, age, and salary. Further create employeel that makes reference to the employee record
and print out the salary of employee 1. [5 marks)
2.
Unnest the following nested if statement: [3 Marks)
If (age>=18) THEN
If (citizenship==" Namibian") THEN
Display "you are eligible to vote".
End IF
END IF
3.
Rewrite the following while loop with a DO WHILE Loop [3 Marks]
i=0
While(i<10)
Display i
i=i+l
END While
4.
Given the following pseudocode, convert it into an equivalent flowchart. [10 Marks)
Start
count= 0, sum = 0
prompt user for a number
get num
WHILE (num !=0)
sum = sum + num
count= count+ 1
prompt user for the number
get num
END While
average= sum/count
display average
END
Page 3 of 6

5 Page 5

▲back to top


5.
Given the following pseudocode, convert the linear if statement into a case structure.
[11 Marks]
Start
Prompt the user for dayOfTheWeek
Get dayOfTheWeek
if(dayOfTheWeek = =1)
display "Monday!"
else if (dayOfTheWeek = =2)
display" Tuesday!"
else if (dayOfTheWeek = =3)
display" Wednesday!"
else if (dayOfTheWeek = =4)
display" Thursday!"
else if (dayOfTheWeek = =5)
display "Friday!"
else if (dayOfTheWeek = =6)
display "Saturday!"
else if (dayOfTheWeek = =7)
display "Sunday!"
else
display" Invalid Day of the week!"
end
6.
Create a function named mileToKM(). The function should take in a value in miles per
hours as the speed measured by the car's speedometer. Convert that measurement to kilometres
and alert the driver if he or she is travelling more than 90 km/hr. use 1 mile = 1.85 kilometres [9
marks]
Page4 of 6

6 Page 6

▲back to top


7.
Write a pseudocode to calculate and print the electricity bill of a given customer. The
customer ID, name, and unit consumed by the user should be captured from the keyboard to
display the total amount to be paid to the customer. The charge is as follow: [14 Marks]
Unit
Up to 199
200 and above but less than 400
400 and above but less than 600
600 and above
Charge/unit
1.20
1.50
1.80
2.00
8.
Create a pseudo-code that takes the total number of students in a class and their
corresponding name and marks for the supplementary test. The program must store these values
in two arrays. Afterwards the pseudocode should display the student's name and marks of
students who marks is >50. [10 Marks]
**************************** End of the Paper***********************************
Page 5 of 6