0% found this document useful (0 votes)
18 views12 pages

IVIP Sample Question

This document contains a 20 question multiple choice quiz about algorithms and programming concepts in Snap!. It is divided into two sections, with Section A containing the 20 questions worth 40 marks total, and Section B containing two longer answer questions worth 60 marks total. The questions cover topics like control structures, variables, lists, arithmetic operations, and pseudocode.

Uploaded by

CHUA YEXUN Moe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views12 pages

IVIP Sample Question

This document contains a 20 question multiple choice quiz about algorithms and programming concepts in Snap!. It is divided into two sections, with Section A containing the 20 questions worth 40 marks total, and Section B containing two longer answer questions worth 60 marks total. The questions cover topics like control structures, variables, lists, arithmetic operations, and pseudocode.

Uploaded by

CHUA YEXUN Moe
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 12

SECTION A

This section contains TWENTY (20) multiple choice questions.


This section carries 40 marks.
Each question carries TWO (2) marks. Answer ALL questions.

1. When the user clicks “when green flag clicked” button, it will _________
a. runs the script
b. runs the block inside condition block
c. points sprite into specified direction
d. none of above

2. Choose the correct notation to represent a decision in a flowchart. a.

a.

b.

c.

d.

3. Which of the following is CORRECT about Algorithm?


a. Step-by-step instructions used to solve a problem
b. A computer program that follows a chart
c. A decision that followed the instructions
d. A syntax that describes the flow of series of events
4. Which of the following is NOT CORRECT?
Algorithms can be represented as:
a. syntax
b. pseudo code
c. program
d. flowchart

5. forever block means _____________


a. runs the script inside infinitely.
b. point sprite in specified direction
c. runs the script one time only
d. move sprite for 10 steps

6. Identify which of the following is not looping structures.


a. If … else
b. Repeat
c. Forever
d. Repeat until

7. Loops in Snap! Programming is implemented using _______


a. All of these
b. Repeat
c. Repeat until
d. For each

8. Three main control structures are ________, __________ and _________.


a. sequence, selection, repetition
b. sequence, notation, iteration
c. flow, selection, repetition
d. flow, selection, iteration
9. ___________ structure will execute an instruction only after the conditions evaluates
to determines if the condition exists or not.
a. Selection
b. Loop
c. Sequence
d. Function

10. Which of the following commands will create an empty list? a.

a.

b.

c.
d. None of these

11. Supposed the joke list consists of items [1, 2, 3, 4], what is the value of

a. 2
b. 3
c. 1
d. 4
12. From figure 1 below, choose the correct coordinate for the centre of the screen.

Figure 1

a. (X:0, Y:0)
b. (X:240, Y:0)
c. (X:0, Y:-180)
d. (X:240, Y:-180)
13. From figure 2 below, which pallet they are belongs to:

Figure 2

a. control
b. pen
c. sensing
d. variable

14. Based on the figure 2 in question 13 previously, which block represent delay timing
block.
a. wait (10) secs
b. if then else
c. forever
d. repeat (10)
15. There are several ways to display data to the user in Snap! Which of the following is
NOT CORRECT? a.

a.

b.

c.

d.

16. Broadcasting and receiving a message is procedure in Snap!. Choose what you can
do with this procedure in Snap!.
a. All of these
b. Hold a conversation
c. Respond to events
d. Control game play

17. ___________ used when defining a function.


a. Parameter
b. Arguments
c. Variable
d. Method

18. In computational practices, which of the following is making something by building


on existing projects or ideas?
a. Reusing and remixing
b. Experimenting and Iterating
c. Abstraction and Modularizing
d. Testing and debugging
19. From figure 3 below, which block that will takes a script as its input and carries out its
instructions.

Figure 3

a. Run
b. Launch
c. Call
d. All of these

20. Object-oriented in Snap! Programming is a prototype-based OOP.


a. True
b. False
Section B
This section carries TWNETY (60) marks.
Question 1 (30 marks)

1. COMPLETE the following logical operator’s table:

X Y X AND Y X OR Y NOT X
False False False False True
False True False True True
True False False True False
True True True True False
[12 marks]
2. Given i = 2, x = 6, j = 3, k = 6, y = 5 , z = 2, a=4, b=5, c=2. SOLVE the arithmetic
equation below:
a. b %=4
5 %= 4 = 1
b. a /=4
4 /= 4 = 1
c. c *=5
2 *= 5 = 10
[6 marks]
d. a = x * ( y % z ) % j + k
a=6*(5%2)%3+6
a=6*1%3+6
a=6

e. r = x % i + y - j * k
r=6%2+5–3*6
r = 0 + 5 – 18
r = -13

f. m = x * (y% z) % (3 * 4)
m = 6 * ( 5 % 2 ) % (3 * 4)
m= 6 * 1 % (12)
m = 6 % 12
m=6
g. n = ( x * z ) / 2 ( 3 * y )
n=(6*2)/2(3*5)
n = ( 12 ) / 2 (15)
n = 6 (15)
n = 90

[12 marks]
Question 2 (30 marks)

a) Solve the problem using the problem analysis to identify the input, process, and
output (IPO) and write a pseudo-code
a. To iterate and display numbers from 1 to 50 in reverse order.

Input Process Output

Numbers from 1 to 50 Iteration Numbers from 1 to 50 in reverse order

Start

define list numbers is numbers from 1 to 50

define variable count is 50

REPEAT

display item of numbers at index count

count -= 1

UNTIL count = 0

End

[15 marks]
b) Write pseudo code that will perform the following.
a. Read in 5 separate numbers.
b. Calculate the average of the five numbers.
c. Find the smallest (minimum) and largest (maximum) of the five entered
numbers.

Start

prompt “Please enter 5 numbers.”, n1, n2, n3, n4, n5

read n1, n2, n3, n4, n5

define variable total is n1 + n2 + n3 + n4 + n5

define variable average is total / 5

define variable maximum

define variable minimum

IF n1 >= n2

maximum is n1

ELSE

maximum is n2

ENDIF

IF n3 >= maximum

maximum is n3

ENDIF

IF n4 >= maximum

maximum is n4

ENDIF

IF n5 >= maximum

maximum is n5
ENDIF

IF n1 <= n2

minimum is n1

ELSE

minimum is n2

ENDIF

IF n3 <= minimum

minimum is n3

ENDIF

IF n4 <= minimum

minimum is n4

ENDIF

IF n5 <= minimum

minimum is n5

ENDIF

Print “The average of the five numbers is”, average

Print “The smallest number is”, minimum

Print “The largest number is,” maximum

End

[15 marks]

You might also like