NEW
Font size
WorksheetsComputer Science - Programming PLC
Total questions: 62
Worksheet time: 45mins
_________________ is a collection of elements used to store the same type of data.
Array
Switch
Case
Loop
What is returned by values[5]?
9
12
6
8
Arrays are declared using _______.
Square brackets [ and ]
Parentheses ( and )
Quotation marks " and "
Curly Braces { and }
______ are ordered collection of data items of the same type referred to collectively by a single name.
Index
Variables
Arrays
Elements
_____ are each variable or cell in an Array.
Array
Variable
Element
Index
_______ are individual data / items in an array.
Index
Element
Type
Value
The _____ of an Array are indicated by the number of square brackets beside it.
Index
Elements
Array
Dimension
______ is an operation in arrays that allows us to add an element from the array.
Delete
Edit
Insert
Search
______ is an operation in arrays that allows us to query for an element from the array.
Search
Delete
Edit
Insert
Instructions (such as a recipe) are written so that each step is performed one at a time, from top to bottom, until the task is completed. This type of instruction process is called:
Sequential
Scripting
Pseudocode
Programs
To focus on the logic and make refinements to a program before translating it into a programming language, a programmer often creates an outline of the program’s algorithm. What is the term for this type of outline?
Pseudocode
Sketch
Compiler
Interpreter
Which Data Type is used to store characters?
String
Integer
Double/Real
Boolean
Which Data Type is used to store decimal numbers?
String
Integer
Double/Real
Boolean
Which Data Type is used to store data with only 2 possible answers?
String
Integer
Double/Real
Boolean
What is a Character?
Words
Letters, numbers and symbols
Which data type would you use to store:
Someone's age
String
Integer
Double/Real
Boolean
Which data type would you use to store:
Someone's name
String
Integer
Double/Real
Boolean
Which data type would you use to store:
Someone's postcode
String
Integer
Double/Real
Boolean
Which data type would you use to store:
Your year group
String
Integer
Double/Real
Boolean
An Integer stores decimal numbers
True
False
A String stores whole numbers
True
False
True/False would be stored as a Boolean
True
False
Variables cannot be changed.
False
True
Constants cannot be changed.
True
False
Which of these values would be useful as a constant?
Pi
Di
Ni
Pie
The value of a constant can be changed using an expression.
False
True
Variable names can include spaces.
False
True
Some specific words can't be used as variables.
True
False
What is another word for 'iteration'?
Selection
Variable Assignment
Repetition
Sequencing
Which python operator means 'less than or equal to'?
>
<
>=
<=
What is the output of the following code?
0,1,2,3,4,5,6,7,8,9,10
0,1,2,3,4,5,6,7,8,9
1,2,3,4,5,6,7,8,9,10
1,2,3,4,5,6,7,8,9
Which code will successfully print the value of x exactly 5 times?
for x in range(0,4):
print(x)
for x in range(0,5):
print(x)
for x in range 5:
print(x)
for x in range[0,5]:
print(x)
How many times will this loop run?
10
9
4
5
I want to allow the program to repeatedly ask the user to enter their guess if it does not equal the answer...Which option do I use?
while guess == answer:
guess=input()
while answer != guess:
guess=input()
while answer =! guess:
guess=input()
while guess != answer:
guess=input()
How many times will 'hello' be printed using this code?
3
6
9
27
Which loop is most appropriate to use if I need to continuously check for a correct password?
FOR loop
WHILE LOOP
I want to print "Password matched" if the user enters the correct password, otherwise allow them to try again. What is wrong with the code above?
last line should be OUTSIDE the loop
wrong operator used
wrong password
for loop needed to be used
What is the advantage of using a while loop versus a for loop?
continuous repetition of instructions
pre-defined number of iterations
What do we do when we need to break down a large complex problem into smaller, more manageable tasks?
Abstract the problem
Fragment the problem
Compile the problem
Decompose the problem
Selection in a program is controlled by...
IF statements
WHILE loops
REPEAT loops
Arrays
An IF statement is triggered by....
Conditions
Comments
Loops
Time
Which of the following statements can be used to extend selection from a single IF statement?
ELSE
DO
CHOICE
ELK
Selection statements in programs can change the flow of control.
True
False
Selection in programs is useful to repeat blocks of code.
False
True
Which of the following is an example of selection in pseudocode?
IF x < 10 THEN
WHEN x < 10
(x < 10) IF TRUE THEN
FOR x=0 TO 10
Which of the following shows a logical error?
while x>2 AND x<1:
for index in range(:
print(Hello")
Which of the following contains syntax errors?
for index in range(1, 5, -1):
While x > 3
if fred == name:
400 is the...
Parameter
Argument
Name
Variable
length is an example of a...
Argument
Parameter
Variable
Procedure call
A function...
Never has parameters
Always returns a value
Must has parameters
Does not return a value
The drawSquare subprogram is an example of a...
Function
Procedure
A While Loop is?
Definite Iteration
Indefinite Iteration
A For Loop is?
Definite Iteration
Indefinite Iteration
NOT AND OR in Selection are examples of ?
Boolean Algebra
Relational Applications
Boolean Operations
Relational Operations
Parameters allow us to pass information or instructions into functionsand procedures.
True
False
Benefits of using Subroutines are?
Reducing duplicate code within a program.
Code can be reused - simply by calling the subroutine
Help programmer to decompose the problem into smaller parts
All
A local variable is inside of a subroutine or function?
True
False
Global variables are declared outside any function
True
False
Structured programming is basically the use of subroutines in your code?
True
False
Python is an example of a high level programming language?
True
False
When translating using an interpreter, each line of source code will be translated to machine code one line at a time.
True
False
100101010101 is an example of what?
High level program code
Low Level program code
