Download as pdf or txt
Download as pdf or txt
You are on page 1of 31

SA2

SA2 PROGRAMMING
REVISION MANUAL

Monash University Foundation Year 10/16/20 MUF0051 ICT UNIT 1


MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

MULTIPLE CHOICE QUESTIONS


1. Which of the following is not one of the three core programming constructs?
a. Sequence
b. Selection
c. Repetition
d. Coding
2. Which of the following is the correct sequence of project stages in programming?
a. Application requirements → development → design → evalua"on
b. Application design →requirement → development → evalua"on
c. Application requirement → design → development → evalua"on
d. Application evaluation → development → design → requirement
3. Which of the following are TRUE regarding programming languages?
a. Programming languages are used to create applications.
b. Programming languages are used to create instructions which are sent to the CPU.
c. Programming languages are used to create software.
d. All of the above
4. How is a sprite animated in a Scratch application?
a. By adding a timer to restrict the time allowed to complete a level
b. By changing the sprite’s costume
c. By changing the backdrop
d. By adding and using a variable
5. Testing and debugging a program occur during which project stage?
a. Application requirement
b. Application design
c. Application development
d. Application evaluation
6. Which of the following are advantages of object-oriented programming?
a. It’s easy to break down a problem into small pieces and tackle each separately.
b. It’s easier to reuse functionality from one project to another.
c. It’s considerably easier to debug a well-written OOP application if something goes wrong
d. All of the above

1
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

7. In testing programs, GIGO (garbage in, garbage out) highlights:


a. The needs for comprehensive checking in programs to reduce the possibilities of invalid
input being accepted as valid input to a program
b. The need for documentation in programs to enhance the communications among
development teams
c. The need for formatting and modularizing code to improve readability and ease debugging
of code
d. None of the above
8. When the following codes are executed, the value stored in variable B will be
when green flag licked
set A to 1
set B to 2
set A to A+1
set B to A+B
stop script
a. 1
b. 2
c. 3
d. 4
9. When the following pseudocode is executed with variables YearEntered and NextYear in
Scratch, the output to the user who inputs 2020 will be
when green flag clicked
ask “Enter a year” and wait
set YearEntered to answer
set NextYear to YearEntered+1
say “It is ” and NextYear and “next year”
stop script
a. It is 2021 next year
b. It is 2021next year
c. It is 2020 next year
d. It is 2020next year

2
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

11. The application must contain a timer and three levels' will appear in which stage?
a. Development
b. Design
c. Evaluation
d. Requirements
12. Custom sprites are created in which stage?
a. Design
b. Development
c. Requirements
d. Evaluation
13. In programming, a variable is used to
a. store data which changes each time the program executes
b. give instructions to the CPU so that it can perform a task
c. control a Sprite in Scratch
d. none of the above
14. In which order are the stages completed when creating an application?
a. Design, development and evaluation
b. Development, design and evaluation
c. Evaluation, development then design
d. Debugging then testing
15. What is evaluation?
a. Planning something.
b. Adding a costume to a sprite.
c. Making a judgement about something.
d. Building something.
16. How is debugging different to testing?
a. Debugging creates errors while testing fixes errors.
b. Debugging is searching for errors while testing is fixing errors.
c. Testing is searching for errors while debugging is fixing errors.
d. They are exactly the same!

3
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

17. The programming construct ITERATION such as the Forever block in Scratch refers to:
a. performing an action if a certain condition is true
b. comparing the values in two variables
c. branching from one part of a program to another
d. repeating a sequence of instructions
18. An advantage of a custom block is:
a. it creates more work.
b. it makes programming harder.
c. it can condense a number of blocks into one block.
d. it takes longer to code the application.
19. A variable’s data type
a. changes as the program executes
b. determines the kind of operations may be performed on the variable
c. determines the type of comment that can be included in the variable’s documentation
d. none of the above
20. The features required in an application are listed in which stage?
a. Debugging and testing
b. Application design
c. Application evaluation
d. Application requirements
21. Storyboards are created in which stage?
a. Design
b. Evaluation
c. Requirements
d. d. Development
22. The programming construct ITERATION refers to:
a. performing an action if a certain condition is true
b. comparing the values in two variables
c. branching from one part of a program to another
d. repeating a sequence of instructions

4
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

23. With respect to an object in a program, a METHOD is


a. A function associated with the object that implements the object’s behaviour
b. An attribute pf the object that can be used to store information associated with the object
c. A procedure used by the programmer to construct the object
d. The way an object is described in programming documentation
24. Which of the following statements is true of logic error:
a. It is caused by misuse of logic when coding the program that leads the program to produce
unintended or undesired output or other behaviour
b. It is caused by the code written not conforming to the syntax of the programming language
being used
c. It can be detected by compiler
d. None of the above
25. Branching constructs in programming allow for:
a. sequential and orderly execution for the portion of code within the construct.
b. selective execution or skipping certain portions of code in a program
c. repetition of the portion of code within the construct.
d. none of the above
26. In high level programming languages, an interpreter...
a. reads individual statements of a program, analyses and then executes them
b. generates codes automatically
c. converts the whole set of codes to machine language so that it can run
d. corrects errors made by the programmer
27. A validation rule of “ > 0 And < 10 “ means that
a. Input must be larger than 0
b. Input must be less than 10
c. Input must be larger or equal to 0 and less than 10
d. Input must be larger than 0 and less than 10
28. Why is modularisation an important programming technique?
a. Because it provides separation of concerns, and improves maintainability by enforcing
logical boundaries between components
b. Because it enforces programmer to document the software
c. Because it improves the performance of a program
d. All of the above

5
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

29. Why is a syntax error relatively easier to identify compared with a logic error?
a. It is because a syntax error would not affect the functionalities of a program and can often
be ignored
b. It is because a logic error can be recognized by compiler at compilation time while
identifying a syntax error can potentially involve comparing all the possible results
generated by the program against the expected results
c. It is because a syntax error can be recognized by a compiler at compilation time while
identifying a logic error can potentially involve comparing all the possible results generated
by the program against the expected results.
d. None of the above
30. Which programming construct should be used if portions of code need to be selectively executed
or skipped based on certain condition(s)?
a. Sequence construct
b. Branching construct
c. Repetition construct
d. Exception construct
31. In the following pseudocode, what is the value of the variable index at the end of the procedure?
set number1 to 1
set index to 1
repeat until index > 5
set index to index + number1

a. 1
b. 4
c. 5
d. 6
32. Referring to the pseudocode in Question 18, what is the value of the variable number1 at the end
of the procedure?
a. 1
b. 4
c. 5
d. 6

6
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

34. In programming, a loop allows for the


a. sequentially and orderly execution of a portion of code within a program
b. selective execution of certain portions of code in a program
c. repetition of a portion of code within in a program
d. skipping of certain portions of code in a program
35. In Scratch, a Sprite is
a. an object/character that can move on the Stage
b. an object/character that can be controlled by scripts
c. used to perform arithmetic and logical instructions
d. a & b
36. Which of the following is not a comparison operator:
a. +
b. >
c. <
d. =
37. What is the purpose of using the backpack in Scratch?
a. To allow the sprites to converse with each other in a seamless manner.
b. To store assets such as blocks to be dragged and dropped between applications.
c. To change backdrops to allow the user to advance to a new level in a game application.
d. To add a variable to keep track of a score of a player in a game application.
38. The following are Events in Scratch except:
a. When green flag clicked
b. When space pressed
c. Broadcast message
d. Wait for 1 sec
39. What is the purpose of using the backpack in Scratch?
a. To allow the sprites to converse with each other in a seamless manner.
b. To store assets such as blocks to be dragged and dropped between applications.
c. To change backdrops to allow the user to advance to a new level in a game application.
d. To add a variable to keep track of a score of a player in a game application.

7
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

41. When the following pseudocode is executed with variables Age and NewAge in the Scratch
pseudocode below, what is the result displayed for a user who is 17?

a. When green flag clicked


b. Ask “Please enter your age” and
c. wait Set Age to answer Set NewAge to (Age + 1)
d. Say “Next birthday you will be” and NewAge
42. In Scratch programming, it is not possible to have the following errors:
a. Runtime errors
b. Syntax errors
c. Logic errors
d. All of the above
43. A Boolean data type can store
a. Text
b. True
c. False
d. True or False

8
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

Sally create the following script in scratch.

44. The line of script is an example of data validation


Data Validation helps to
a. Reduce the chance of correct data being output
b. Reduce the chance of incorrect data being input
c. increase the chance of incorrect data being input
d. test the application to check if all functions are working correctly
45. Which is the best set of test data to test the validation rule?
a. 0, 1, 199,200
b. 0, 1, 200, 201
c. 1, 2, 198, 199
d. -1, 0, 200 201
46. A variable used in the script above is
a. Score
b. Age
c. 200
d. If Then Else
47. An operator used in the code above
a. 0
b. <
c. Age
d. +

9
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

48. is an example of which programming construct?


a. List
b. Sequence
c. Interaction or repetition
d. Condition or selection
49. Below is a script from a Scratch application. What type of shape will be drawn after the script is
executed

a. Square
b. Triangle
c. Rectangle
d. Circle

10
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

50. ____________ is a software that is used to create a series of instructions that will control the
behaviour of a computer
a. Instructions
b. Programming language
c. System Software
d. Application Software
51. __________________ is a series of connected instructions or blocks
a. Blocks
b. Scripts
c. Functions
d. Iteration
52. Below is a script from a Scratch application. What type of shape will be drawn after the script is
executed

a. Square
b. Triangle
c. Rectangle
d. Circle

11
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

53. Below is a script from a Scratch application. What type of shape and colour will be drawn after
the script is executed

a. Rectangle
b. Red Square
c. Red Rectangle
d. Circle
54. Identify the type of event used in Question 51
a. When this sprite is clicked
b. When flag clicked
c. When I receive move
d. When backdrop switch to Shapes

12
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

55. Identify the category of blocks used in the Question 51


a. Events, Motion, Pen
b. Iteration, Sequence, Selection
c. Motion and Pen
d. Events, Motion, Pen, and Control
56. ____________________ is a group of instructions can be combined into single custom block
which save time and effort
a. Functions
b. Scripts
c. Block
d. Stage
57. When the following pseudocode is executed
When green flag is clicked
Set X to 5
Set X to X + 1
Set Y to X + 3
Say Y
The value stored in the variable Y will be
a. 0
b. 5
c. 8
d. 9

13
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

59. Below is the script from a Scratch Application. What will be the result of the following script if the
number 5 is entered?

a. 5
b. 20
c. 15
d. 10
60. Below is the script from a Scratch Application. What is the value of final value of counter and
results

a. 5 and 15
b. 10 and 5
c. 15 and 5
d. I5and5

14
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

61. Below is the script from a Scratch Application. What is the value of final value of x and y

a. 31 and 12
b. 31,12
c. 12 and 31
d. None of the above
62. ______________ is a single line of code which instructs CPU to perform task in Scratch, blocks
are used.
a. Internal documentation
b. Instruction
c. Stage
d. Backdrop

15
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

64. Below is the script from a Scratch Application. What is the value of final value of a and i

a. 7, 5
b. 5 and 7
c. 5,7
d. 7 and 5

16
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

66. Below is the script from a Scratch Application. What is the value of final value of a

a. 11
b. 21
c. 20
d. 5

17
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

67. Below is the script from a Scratch Application. What is the value of final value of a

a. 25
b. 20
c. 35
d. 50

18
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

69. Below is the script from a Scratch Application. What is the value of final value of a

a. 26
b. 21
c. 35
d. 20
70. A single environment where all the development of an application occurs
a. Integrated Development Environment (IDE)
b. Internal Documentation
c. Function
d. Scripts

19
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

71. A sprite is an object that can move. A sprite can also be re-sized, unlike a backdrop.
a. True
b. False
72. Most applications will have at least one sprite.
a. True
b. False
73. Blocks can be selected from the blocks palette
a. True
b. False
74. A block is an instruction.
a. True
b. False
75. Blocks have been organised into 10 groups
a. True
b. False
76. Each block in a group will have the same colour.
a. True
b. False
77. ____________________ is a programming language model organised around objects rather than
the actions and data rather than logic
a. Object-oriented methodology
b. Object-Oriented programming
c. Object-oriented model
d. Low level language
78. Scripts are created in
a. Backdrop
b. Block Platte
c. Script Area
d. Sprite Area
79. Which control structure executes instructions in the order that they are written?
a. Selection
b. Sequence
c. Assignment
d. Iteration

20
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

Use the following pseudocode to answer questions 74 to 78


Below is the script for an application

80. Identify the output produced by the application if the test data of 100 was input.
a. Weight
b. Weight out of range.
c. You are a healthy weight.
d. You are a very healthy weight.
81. Which of the following lines of code in the pseudocode contains an operator?
a. Else
b. Input Weight
c. If Weight > 100 Then
d. Print “You are a very healthy weight”
82. Which type of control structure is used in the application?
a. Sequence and Selection
b. Sequence and Iteration
c. Selection and Iteration
d. Sequence, Selection and Iteration

21
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

83. Which is the best set of test data to test the validation rule below?

a. -1, 0, 1, 999, 1000,1001


b. 1, 999
c. 0, 1, 999, 1000
d. 100,101
84. Which is the best set of test data to test the validation rule below?

a. -1, 100, 101


b. 99,100,101
c. 100, 101
d. All of the above
85. Scratch is a
a. Visual programming language
b. Programming language
c. Design Application
d. Console Application
86. The relationship between blocks and scripts
a. A block a set of instructions and a script is an instruction
b. A block is a single instruction and script is a collection of blocks
c. A block is a single word and script is a collection of words
d. All the above
87. A complete Scratch program is known as
a. Project
b. Application
c. Project or Application
d. None of the above

22
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

89. The figure below shows

a. A conversation between two sprites


b. A conversation between user and sprite
c. A conversation between user and user
d. None of the above
90. A custom block is a block that the user creates themselves. Custom blocks allow a number of
blocks to be compressed into a single block.
a. True
b. False
91. ______________ are comments that are added to the code. The purpose of the comments is to
explain how the script works.
a. External documentation
b. System documentation
c. Internal documentation
d. User documentation

23
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

Structured Questions

1. A program is created to accept input and display the Name and YearOfBirth and Gender of
a student. The input into this program should be validated.
For example, Name might be entered as “John Doe”, YearOfBirth might entered as 1998
and Gender might be entered as “M”.
a. What is the importance of validation in programming?

b. Give an example of how validation can be done in the above program.

[2 marks]

2. In Scratch, when the sprite called Cat is clicked, the Cat is made to repeatedly move 5 steps
forward and 5 steps backward 100 times and then say “That’s tiring”.
a. Write the Scratch codes to achieve the above (using iteration).
[5 marks]

b. Explain how the iteration works.

[2 marks]

3. Determine the value stored in variable x and variable y at the end of the execution of these
scripts.
set x to 4 set y
to 2 repeat
until y = 0 set
x to x-1 set y
to x-2

Variable x = _______________________________________________________________
Variable y = _______________________________________________________________
[2 marks]
4. Determine the output at the end of the execution of these scripts.
set b to 10
set a to 20 set b to
b + a if a * 4 > b *
2 Then say b
else
say a

Output = __________________________________________________________________
[2 marks]
5. Why are variable types important in programming? Explain your answer with examples to
support your explanation.

24
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

[2 marks]

6. List and briefly describe the Project Stages


[6 marks]

9. Describe the three types of programming errors with examples?

[6 marks]

10. Trace the following lines of Scratch codes and fill in the values of the variables in the tables below
when these codes are executed.
1 set z to 3
2 set y to 1
3 set x to 2
4 repeat until x > 15
5 change x by 3
6 set z to x + y
7 set y to z + 2
8
VARIABLES
Lines executed
x y z
1, 2, 3 2 1 3
4-7

4-7

4-7

4–7

4-7

Variable values at the end


of execution:
[5 marks]

25
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

11. Identify and define the script above

a. Explain the script above

b. Discuss an advantage of using the script above


[1 + 2 + 1 marks]

12. Logic error is an example of an error in a computer program.


a. What are logic errors in a program?

b. Why are logic errors the most difficult type of error to detect?

[2 marks]

13. How can a programmer detect logic errors in a program?


[2 marks]

14. Trace the following lines of Scratch codes and fill in the values of the variables in the tables below
when these codes are executed.
1 set bob to true
2 set cat to 10
3 set x to 2
4 repeat until cat > 20
5 change cat by 2
6 set x to x + cat
7 change x by 1
8 if cat < x Then
9 set bob to false

26
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

10 set cat to cat + 4


11 else
12 set bob to true
13 set cat to cat + 2

VARIABLES
Lines executed
bob cat x
1, 2, 3 true 10 2

Variable values at the end


of execution:
[6 marks]
15. What are programming languages? Give an example of a low-level programming language and an
example of a high-level programming language.
[2 marks]

16. How are low-level and high-level programming languages different in terms of complexity and
portability?

[2 marks]

17. Explain the difference between non-array variables and lists (arrays). Provide an example of a
programming situation where a list (array) would be appropriate.

[3 marks]

18. List and briefly describe the three core constructs of a computer program
[3 marks]

19. Outline the purpose of backdrop in Scratch


[3 marks]

20. Outline the purpose of sprite in Scratch


[3 marks]

27
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

21. Describe TWO differences between backdrop and sprite


[3 marks]

22. Outline what us the purpose of stage


[3 marks]

23. Define what is scripts and what is the purpose of scripts


[3 marks]

24. Define the repletion control block. Briefly explain three example of repetition block
[4marks]

28
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

25. You were asked to create an application with the following requirements
• User input customer’s name and age
• If the age is at least 21 then print – You are eligible to vote.
• If the age less than 21 then print – Too Young. You are not eligible to vote.
You have created the script for the application.

29
MUF0051 ICT UNIT 1 REVISION MANUAL SA2 – SCRATCH PROGRAMMING

a. Define the term control structure


[1 mark]

b. Describe, using examples, the different control structures used in the script above.
[4 marks]
c. Identify the operators used in the script above. Explain the purpose of the operator
[3 marks]

d. Explain the purpose of variable in programming.


[3 marks]

e. List the block in your script that contain the variable


[3 marks]

f. List and describe one block that was used to create the conversation in between the Scratch Cat
and User
[3 marks]
You realise that your script contains error

g. Identify the type of error your script produces


[3 marks]

When you enter 22 you realise that the program displays the greeting Hi There <name> and not the
message “You are eligible to vote”

h. Identify the problem and suggest a correction


[3 marks]

After correctio the script for part (d) You realise that when you enter 21 you realise that the
program displays the greeting Hi There <name> and message “Too young. You are not eligible to
vote”

i. Identify the problem and suggestion a correction


[3 marks]

30

You might also like