10 Flowchart and Pseudocode - 12feb2022
10 Flowchart and Pseudocode - 12feb2022
12 February 2022
Past paper questions
1. If N is an integer variable, the following code: OL2008MCQ26
N=10
DO while N>=5
N=N-1
LOOP
1)Executes 6 times 2)executes 5 times 3)never begins 4)never ends
1)a sequence 2)a simple selection 3)both sequence and simple selection
4)an iteration
10.
12. Select the operator that has the highest priority in the list of operators
{<>, +, <, OR, MOD} GIT2009MCQ33
1) <> 2)+ 3)OR 4)MOD
What are the outputs of the flowchart, if the current temperature is 28°C,
27°C, 26°C respectively? OL2010MCQ23
1)Cold, Cold, Cold 2)Hot, Cold, Cold 3)Hot, Hot, Cold 3)Hot, Hot, Cold
4)Hot, Hot, Hot
14. Which of the following control structures are required to convert the
following flowchart into a computer program? OL2010MCQ24
A - If Then construct B - If Then Else construct C - For Loop D - Do-
While loop
1)A only 2)B only 3)For Loop 4)Do-While Loop
15. Which of the following data types is suitable for the variable C and R in
the above flowchart?OL2009MCQ25
1)String 2)Real 3)Boolean 4)Currency
20. Choose the most correct decision that terminates the iteration. GIT2010MCQ33
1)X>15 2)X<15 3)X>=15 4)X<=15
22. If the decision X > 15 is changed to X >= 15, the output of the flowchart is
GIT2010MCQ35
1)9 2)12 3)15 4)18
24. Which of the following can be used to replace "Add num to total" in the
flowchart?OL2011MCQ23
1) num = num+total 2) total = num*total 3) total = total+num 4) total =
total/num
27. Choose the most correct condition that executes the process Tax =0.01*pay in
the flow chart.GIT2011MCQ34
A – Status < 1
B – Status > 1
C – Status = 1
1)A only 2)B only 3)Either A or B 4)B and C only
32. Consider the following flow chart for the below 3 questions
What are the control structures that represent the decision "Is X <=10? And
"Is X an even number" respectively?GIT2012MCQ32
1)Sequence, Iteration 2)Iteration, Selection 3)Iteration, Sequence
4)Selection, Iteration
33. Consider the most correct decision that terminates the iteration.
GIT2012MCQ33
1)X>10 2)X<10 3)X <= 10 4)X >= 10
37. Which of the following statements about the algorithm represented by this
flow chart is correct if the user inputs the value 6?AL2012MCQ44
1)It stops when the value of i is equal to 6.
2)It prints the value 4 as one of its outputs.
3)It prints the value 2 as one of its outputs.
4) It prints all the integers from 1 to 6.
5)It prints all the integers from 1 to 5.
38. Sarah has been asked to write a computer program to compute the average
rainfall in an year. Consider the following included in the computation.
OL2013MCQ25
A - number of days in the year.
B - calculating the total rainfall for the year by adding together rainfall
for each day of the year.
C - calculating average rainfall by dividing the total rainfall from number
of days in the year.
D - the average rainfall for the year.
E - rainfall for each day of the year.
Which of the following is true regarding input, processes and output of the
above computation?
1)Inputs: A, B processes: C, D output: E
2)Inputs: A, E processes B, C output: D
3)Inputs: A, D processes:B, C output:E
4)Inputs: B, E processess:A, C output:D
39. What is the result after evaluation of the expression 1+3*5-2, considering
the operator precedence of programming languages?OL2013MCQ28
1)10 2)12 3)14 4)18
Which of the following control structure have been used in the above
flowchart? GIT2013MCQ34
1)repetition, selection and sequence 2)repetition and sequence
3)repetition and selection 4)selection and sequence
41. What is the value of x, when the above taxi_fare calculations process
terminates?GIT2013MCQ35
1)x = 4 2) x = 5 3)x = 6 4)x = 7
43. What is the output of the flowchart, if the condition "is x = 1" is changed
to "is x = 2"?GIT2012MCQ37
1)120 2)155 3)190 4)225
45. The following pseudo code is used to select candidates based on Age, Height
and Weight to call for an interview for a certain job. OL2014MCQ22
If (Age >= 21 AND Age<=40) AND (Height>=155 OR Weight >=55)
Then output 'Qualified for Interview'
Else output 'Not qualified for Interview'
Two candidates Sumith and Raju have the following values for Age, Height and
Weight.
Name Age Height (cm) Weight (kg)
Sumith 26 157 52
Raju 33 154 54
Who will be qualified for the interview?
1)Sumith only 2)Raju only 3)Both Sumith and Raju 4)None of them
47. What is the value of num after the execution of this pseudo code?
OL2014MCQ26
1) 3 2)7 3)10 4)11
48. Which of the following is required to replace the statement in line 2 of the
above pseudo code to calculate the sum of even numbers in the same range?
OL2014MCQ27
1)num=-1 2)num=2 3)sum=1 4)sum=2
51. Marks for 10 subjects of a student are stored in the array 'marks' with the
index ranging from 1 to 10. A pseudocode to calculate the average marks with
three labels Ⓟ, Ⓠ and Ⓡ is given below. OL2015MCQ36
total_marks = Ⓟ
for i=1 to 10
begin
total_marks = total_marks+marks[Ⓠ]
end
average_marks = total_marks/Ⓡ
1) 0, 10, i 2) 0, i, 10 3)10, i, 10 4)10,10, I
55. Consider the 'while' loop and the 'repeat until' loops given below:
OL2015MCQ40
count_A = 1 count_B = 1
while count_A <= 10 repeat
count_A = count_A + 2 count_B = count_B + 2
end while until count_B <= 10
What are the values of count_A and count_B after completion of the execution
of while and repeat until loops respectively?
1) 9 and 9 2)9 and 11 3)11 and 9 4)11 and 11
56. The labelled flowchart shows the steps to be followed for crossing the road
safely. The relevant activities involved are listed. GIT2015MCQ33.
Ⓟ, Ⓠ, Ⓡ and Ⓢ. GIT2015MCQ34
Ⓟ - Display the error message.
Ⓠ - Are the user name and pasword valid.
Ⓡ - Enter the name and password
Ⓢ - Permit user into the system.
Which of the following gives the correct matching?
1)A:Ⓟ, B:Ⓠ, C:Ⓡ, D:Ⓢ 2)A:Ⓠ, B:Ⓡ, C:Ⓟ, D:Ⓢ 3)A:Ⓡ, B:Ⓠ, C:Ⓟ, D:Ⓢ
4)A:Ⓢ, B:Ⓠ, C:Ⓡ, D:Ⓟ
58. Which of the following represents the logic in the given flowchart
segment?GIT2015MCQ35
59. Consider the pseudocode with the label Ⓧ to calculate the sum of numbers
from 1 to 100. OL2016MCQ37
sum = 100
num = 0
repeat
num = num + 1
sum = sum + num
until Ⓧ
For the above mentioned pseudocode, what is the correct condition that
matches with the label Ⓧ?
1) num < 100 2) num<=100 3)num>100 4)num >=100
Below 2 questions are based on the following flowchart designed to find the
smallest number from any ten numbers.
63. Which of the following represents the logic of the given flowchart?
GIT2016MCQ33
1)Do A 2)Do A
If B then While Not(B)
Do C Do D
Else Endwhile
Do D Do C
EndIf
3)Do A 4)Do A
While B If Not(B) Then
Do D Do C
Endwhile Endif
Do C Do D
66. How many times the while loop in the given program segment is executed?
GIT2016MCQ38
1) 2 2)3 3)4 4)5
What values will be displayed for X and Y respectively, if the inputs are X
=10 and Y =20 for the given flowchart?
(l) 10. 10 (2) 10,20 (3) 20, 10 (4) 20, 20
68. Consider the following pseudocode with label Ⓟ to find the product of
numbers from 1 to 10. OL2017MCQ25
product = 1
number = 0
repeat
number=number+1
product = product * number
until Ⓟ
Which of the following expressions is correct for label Ⓟ?
(l) number>1O (2) number<1O (3) number>=1O (4) number<=10
69. Which of the following pseudocode segments is equivalent to the logic of the
algorithm given in the
flowchart?OL2017MCQ26
72. The area and the circumference of a circle is calculated using πr² and 2πr
respectively where r is the radius of the circle and π is a constant(π =
22/7). The labelled flowchart shown repeatedly reads the radius of the
circle and calculates and displays its area and circumference. The labels Ⓟ
, Ⓠ , Ⓡ and Ⓢ need to be identified appropriately from A, B, C and D
given below.GIT2017MCQ37
73. Below three questions are based on the following flowchart which calculates
the number of students who are present and absent in a class of a school.
GIT2017MCQ38
75. Which of the following is the most suitable control structure to implement
the iteration in this flowchart?GIT2017MCQ40
1)Do-While 2)If-Then 3)If-Then-Else 4)While-Do
77. Marks obtained by 10 students for the ICT paper is given in the following
array A, which has indexing stating at 0.
Which of the following indexed items can be used to retrieve the highest
mark?OL2018MCQ36
1) A[0] 2)A[1] 3)A[7] 4)A[9]
78. How many times will the $ mark be displayed after the execution of the
following pseudocode? (Only one answer has been altered from the exam paper)
OL2018MCQ37
BEGIN
P=0
REPEAT
Q = P MOD 2
IF Q = 1 THEN
DISPLAY '$'
ENDIF
P = P + 1
UNITL P < 5
END
1)0 2)1 3)2 4)3
79. Consider the flowchart on the right which inputs a number and displays the
message 'Valid Mark' if the input number is between 0 and 100. OL2018MCQ38
84. What would be the output if a user inputs the numbers 4, 5, 2, -1 one after
the other for the following pseudo-code segment. OL2019MCQ37
terminal = -1
x = 0
REPEAT
DISPLAY "Enter number"
GET num
If num>x THEN
x = num
ENDIF
UNTIL num = terminal
DISPLAY x
1)-1 2)0 3)4 4)5
87. What would be the output of the following Pseudo code? OL2020MCQ37
BEGIN
sum = 0
count = 5
REPEAT
sum = sum+ count*count
UNTIL count > 0
DISPLAY sum
END
1)25 2)41 3)50 4)55
91. i)The following flowchart shows an algorithm that reads two numbers and
display smaller number.OL2017
Write the pseudocode for the algorithm in the flowchart given above.
Ii)The following flowchart reads three numbers and finds the smallest .
Write down the correct expression for missing labels Ⓟ and Ⓠ
92. Consider the given flowchart that finds the product of an integer with all
the integers below it. OL2018