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


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



1 Page 1

▲back to top


nAmlBIA UnlVERSITY
OF SCIEnCE Ano
FACULTY OF COMPUTING AND INFORMATICS
DEPARTMENT OF COMPUTER SCIENCE
QUALIFICATION: BACHELOR OF COMPUTER SCIENCE, BACHELOR OF INFORMATICS
QUALIFICATION CODE: 07BCMS, 07BAIT
LEVEL: 5
COURSE: INTRODUCTION TO COMPUTING
COURSE CODE: ICG511S
DATE: JUNE 2022
PAPER: THEORY
DURATION: 2 HOURS
MARKS: 60
EXAMINER(S)
MODERATOR:
FIRST OPPORTUNITY EXAMINATION QUESTION PAPER
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 5 PAGES
(Including this front page)
1

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.
Which of the following statements is correct?
A. number * 6 = product
B. 'e' = vowel
C. lastName = 'Mwanawasa'
D. isPresent = "true"
E. count++
2.
A string is...?
A. A whole number
B. Letters, numbers, or punctuation
C. A number with a decimal
D. True or False
3.
What is the difference between a flowchart and pseudocode?
A. A flowchart is diagramatic whilst pseudocode is written in a programming
language (eg. Pascal or Java)
B. A flowchart is a diagrammatic description of an algorithm whilst
pseudocode is a textual description of an algorithm
C. A flowchart is textual, but pseudocode is diagrammatic
D. A flowchart and pseudocode are the same thing
4.
Which type of control structure is shown in the below flowchart?
Previous
statement
No
Statement I
Statement 2
A. Repetition
B. Sequential
..,

3 Page 3

▲back to top


C. Selection
D. Case
5.
In a flowchart, a calculation (process) is represented by __ ?
A. diamond
B. Rectangle
C. Parallelogram
D. A circle
6.
Which of the following statements are correct about 6 used in the program?
int num[6];
num[6]=21;
A. In the first statement 6 specifies a particular element, whereas in the second
statement it specifies a type.
B. In the first statement 6 specifies an array size, whereas in the second
statement it specifies a particular element of array.
C. In the first statement 6 specifies a particular element, whereas in the second
statement it specifies an array size.
D. In both the statement 6 specifies array size.
7.
While comparing two variables, their datatypes / format should be the same.
A. True
B. False
8.
You can have an IF without an else but not an else without an IF.
A. True
B. False
9.
Sequential, selection and iterative control are all based on a given condition.
A. True
B. False
10. To check multiple conditions, nested control structure can be used.
A.
True
B.
False
3

4 Page 4

▲back to top


SECTION B: Structured Questions [50 Marks]
Answer all the questions in the provided booklet.
The section consists of 5 questions.
1.
A pseudocode algorithm assigns values to three variables as follows:
GateOpen =
FALSE
Alarm
=
TRUE
PowerFail =
TRUE
Evaluate the expressions given in the following table:
Expression
Evaluates to
Alarm OR NOT PowerFail
NOT (Alarm AND PowerFail)
(GateOpen OR Alarm) AND PowerFail
(GateOpen AND Alarm) OR NOT PowerFail
[4 marks]
2.
Unnest the following nested if statement pseudocode snippets:
[3 marks]
IF {subject<> 11/CG"} THEN
If (testMarks >50} THEN
Display "You are not an FCJstudent. 11
ENDIF
END/F
3.
Identify the inputs, process, and outputs for a program that is required to
determine the average grade of your class. [4 Marks]
4.
Convert the following case structure into a linear if statement:
[ 4 Marks]
CASEOF (record_code)
'A': increment counter A
'B': increment counter B
'C': increment counter C
default: increment error counter
ENDCASE
4

5 Page 5

▲back to top


5.
Consider the following formula: N= X*X/(1-X). The formula is used to calculate N.
The calculation is repeated until a sentinel of X=0 is entered. Create a program that will
show the repeated calculation using pseudocode. The program should receive the
value of X. An error message should be display if 1 is entered as a value of X. The
program should then print the value of X and N. [6 marks]
6.
Convert the following pseudocode into a follow chart:
START
Prompt the user for the house value
Get houseValue
[12 Marks]
Prompt the user for the amountOfWaterUsed
Get amountOfWaterUsed
monthlyAmount=0
IF {house Value> 500 000} THEN
monthlyAmount= (amountOfwaterUsed*20} +{0.05*houseValue)
ELSEIF (houseValue > 300 000} AND {houseValue <500 000} THEN
monthlyAmount= (amountOfwaterUsed*20} +{0.03*houseValue)
ELSE
monthlyAmount= (amountOfwaterUsed*20}
END IF
END IF
Display monthlyAmount
END
7.
Create a program using pseudocodes which takes a temperature input over a 100-
day period (once per day) and display the number of days when the temperature was
below 20C and the number of days when the temperature was 20C and above.
[10 marks]
8. Write a program using pseudocodes algorithm that would enable the user to enter student
marks for 100 students. The program should then determine whether the mark entered is a
pass or fail given that the pass mark is 50. [8 Marks]
************ Endof the Paper***************
s