0% found this document useful (0 votes)
42 views

Grade 6 Worksheet Programming 1

Uploaded by

tran phuong
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views

Grade 6 Worksheet Programming 1

Uploaded by

tran phuong
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Computational Thinking and Programming 1

Grade 6
Name: ……………………………………………………
Class: ………..

INSTRUCTIONS
● Answer all questions.
● Write your answer to each question in the space provided.
● You should show all your working on the question paper.

INFORMATION
● The total of this paper is 23.

1. Look at the following block code from Scratch and Python code.

greeting = input(“Insert greeting: “)


print(greeting)

The second code block from Scratch is which component of code?


variable | input | output | processing
………………………………………………………………………………………………[1]
Name the data type of this component.
………………………………………………………………………………………………[1]
Does this Python code and Scratch block code have the same result?
………………………………………………………………………………………………[1]
2. Neville is writing a program to find out if a person can vote. Read the program code
below and rewrite it with all errors fixed.

a. age = int(input("Input your age: ")


if age!= 18:
print(You can vote!)
else:
print("You cannot vote!")
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………
………………………………………………………………………………………………[3]
b. Identify the data type of age.
………………………………………………………………………………………………[1]

3. The area of a rectangle is calculated by multiplying length by width.


Consider the flowchart below:

a. Complete the missing part of the flowchart so the algorithm calculates the
area of a rectangle. [2]
4. Consider the following algorithm presented as a flowchart.

a. State the values that are displayed when the input of num is:
i. 60
………………………………………………………………………………[1]
ii. 4
………………………………………………………………………………[1]
5. You are asked to create a flowchart to calculate and display the area of a rectangle
given its length and width using the algorithm below.

START ____________
INPUT length ____________
INPUT width ____________
Calculate the area = length * width ____________
OUTPUT area ____________
IF area < 100 Then ____________
OUTPUT “The area is not too big.” ____________
ELSE
OUTPUT “The area is too big.” ____________
ENDIF
STOP ____________

Choose the letter of the correct flowchart symbol to be used for the
given lines of code.
Flowchart Symbols:

A. B.

C. D.

[4]
6. Fill in the blanks:

if (x __________ y):

print(“x is greater than y”)

elif (x __________ y):

print(“y is greater than x”)

elif (x __________ y):

print(“x is equal to y”)

else (“x is not equal to y”) [3]

7. Draw a flowchart that shows the following algorithm:


- ask for an input integer called “number”
- calculate the double of “number” and assign it to a variable called “double”
- if “double” is greater than 100 output “Big!”
- else output “Small…”

[5]

You might also like