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


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



1 Page 1

▲back to top


nAm I BIA un IVE RSITY
OFSCIEnCEAno TECHn OLOGY
FACULTYOF COMPUTINGAND INFORMATICS
DEPARTMENTOF SOFTWAREENGINEERING
QUALIFICATION:BACHELOROF COMPUTERSCIENCE,BACHELOROF INFORMATICS
QUALIFICATIONCODE:07BCMS, 07BAIT
LEVEL:5
COURSE:INTRODUCTIONTO COMPUTING
COURSECODE:ICG511S
DATE:JULY2024
PAPER:THEORY
DURATION: 3 HRS
MARKS: 75
SUPPLEMENTARY/ SECONDOPPORTUNITYEXAMINATION QUESTIONPAPER
EXAMINER(S)
Mr MIKE KALE
MODERATOR
Mr PETERGALLERT
THIS QUESTIONPAPERCONSISTSOF 8 PAGES
(Including this front page)
INSTRUCTIONSTO STUDENTS
1. Readall 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.

2 Page 2

▲back to top


SECTIONA: 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 does the term Algorithm mean? [1 Mark]
A. It is a set of steps to solve a problem.
B. Identifying patterns within your pseudocode.
C. Solving a problem in programming code.
D. It is making sure you fully understand a problem.
2. Which of the following is the correct naming convention of a function? [1 Mark]
A. MyFunction []
B. MyFunction ( )
C. myFunction []
D. myFunction ()
3. What is the output of the following pseudocode? [1 Mark]
e=S
f = 10
IF (e < f AND f < 2) THEN
DISPLAY"Green"
ELSE
DISPLAY"Red"
ENDIF
A. Green
B. Red
C. Green Red
D. No output
Page 2 of 8

3 Page 3

▲back to top


4. The process of breaking down large programs into modules is known as [1 Mark]
A. Modularisation
B. Declaration
C. Initialisation
D. Incrementation
5. Which of the following statements is correct. [1 Mark]
A. My Name= "James"
B. myName = 'James'
C. myName = James
D. myName = "James"
6. The value of a string variable can be surrounded by single quotes. [1 Mark]
A. True
B. False
7. A variable is used to store a value.
A. True
B. False
8. When changing a variable, only incrementing by 1 is allowed. [1 Mark]
A. True
B. False
9. Parameters are specified after the function name, inside parentheses. [1 Mark)
A. True
B. False
Page 3 of 8

4 Page 4

▲back to top


10. A local variable is a variable that is declared inside a function and is accessible to all
functions. [1 Mark]
A. True
B. False
Page4 of 8

5 Page 5

▲back to top


SECTION B: Structured Questions
[65 Marks)
Answer all the questions in the provided booklet.
The section consists of 8 questions.
1. Convert the following nested IF statement to a combined IF statement (Unnest the
following nested IF statement). [4 Marks)
IF (final Mark>= 50} THEN
IF(examMark >= 40) THEN
DISPLAY"Pass."
ENDIF
ENDIF
2. Write a pseudocode that will assist a car dealership company to determine the selling
price of a vehicle based on the brand. The program should accept the brand and price of a
vehicle from a user and calculate the selling price of that vehicle. If the user enters a
brand other than Audi, BMW or Mercedez Benz, the program should display "Invalid
brand". The program should then display the brand and the selling price of the vehicle to
the screen. The selling price is calculated by subtracting the discount from the price of the
vehicle.
Your pseudocode must satisfy all the rules below.
• If the brand is an Audi, the discount is 5%.
• If the brand is a BIVIW,the discount is 6%.
• If the brand is a Mercedez Benz, the discount is 7%.
a. Identify the inputs and outputs in the problem above. [4 Marks)
b. Write a complete pseudocode for the problem above. [10 Marks)
Page 5 of 8

6 Page 6

▲back to top


3. Covert the following pseudocode into a flowchart. [6 Marks)
Start
count= 10
WHILE (count<= 20)
DISPLAYcount
count = count + 1
ENDWHILE
End
4. Convert the following Case Structure to a Linear IF Statement pseudocode. [9 Marks]
Start
Prompt user for response
Get response
CASEOF (response) {
1: X = X + y
2: X = x-y
3: X = X * y
4: x = x / y
default: Display "No output."
ENDCASE
End
Page 6 of 8

7 Page 7

▲back to top


5. Convert the following pseudocode into a flowchart. [9 Marks]
Start
PROMPT user for credit score
GET creditScore
IF (creditScore > 700) THEN
interestRate = creditScore + (creditScore * 0.15)
ELSEIF (creditScore >= 600) THEN
interestRate = creditScore + (creditScore * 0.20)
ELSE
interestRate = creditScore + (creditScore * 0.25)
ENDIF
ENDIF
DISPLAYinterestRate
End
6. Write a pseudocode to assist a librarian in categorizing books based on their publication
years. The program should prompt the librarian for the publication year of a book. Then,
it should categorize the book into one of the following age categories: "Classic",
"Modern", or "Contemporary". Use the variable currentYear to represent the current
year when the librarian is categorizing the book. (8 Marks]
The criteria for categorisation are as follows:
Classic:Books published more than 50 years ago.
Modern: Books published between 20 and 50 years ago (20 and 50 years inclusive).
Contemporary: Books published within the last 19 years.
Page7 of 8

8 Page 8

▲back to top


7. Write a pseudocode that will display all even numbers from 250 to 450. Use a loop
(repetition) for your solution. [6 Marks]
8. Create a function named addNumbers(), that will display the sum of 10 numbers received
as input from the user. Your solution must include a function call. [9 Marks]
************************ End of the Paper************************
Page 8 of 8