Font size
WorksheetsITX202 Programming Practice
Total questions: 85
Worksheet time: 1hrs 25mins
What is the only thing that computers understand?
Machine Code
Low Level Language
High Level Language
Algorithm
Before a computer can understand a program it must be...
Translated into its machine code.
Translated into a high level language.
Translated into a low level language.
Java, Python, PHP, and C++ are examples of
low level languages
Graphic arts languages
medium level languages
high level languages
It is the process of creating a sequence of instruction to enable computer to do something.
Coding
Programming
Algorithm
Which of these is the process of typing a series of instructions to have a computer perform a task?
programming
computing
composing
creating
Which of these is the set of rules that must be followed when typing code using a programming language?
Syntax
Value
Expression
Statement
Which of these is a series of instructions that solve a problem?
Algorithm
String
Array
Statement
What should be considered when designing an algorithm?
If there is more than one way of solving the problem
If the correct hardware is being used
If the correct software is being used
What are the two main ways that algorithms can be designed?
Images or videos
In pseudocode or as a flowchart
By hardware or software
What is pseudocode?
A way of describing a set of instructions in text form
A specific programming language that all computers use
A diagrammatic representation of a set of instructions
What is a flowchart?
A flowchart is a text-based way of designing an algorithm
A flowchart is a specific programming language
A flowchart is a diagram that represents a set of instructions
What is the symbol for a decision in a flowchart?
A parallelogram
A diamond
A circle
Which of these is the correct symbol for a process in a flowchart?
A diamond
A rectangle
A parallelogram
How are symbols connected together in a flowchart?
Symbols do not get connected together in a flowchart
With lines and an arrow to show the direction of flow
By numbers
Which symbol is used for a connector in a flowchart?
A parallelogram
A diamond
A circle
When can algorithms be used?
Only with computers
To design a solution to any problem
For programming
What is important to remember when designing an algorithm?
whether to use a flowchart or pseudocode
the instructions are in the correct order
that it must be easy to read
A boolean is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
An integer is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
A real is...
A whole number
A number with a decimal part
Letters, numbers or punctuation
True or False
The best data type for an age is...
integer
real
string
boolean
The best data type for a name is...
integer
real
string
boolean
The best data type for an average is...
integer
real
string
boolean
The best data type for a counter is...
integer
real
string
boolean
8.2 is a...
integer
real
string
boolean
2.0 is a...
integer
real
string
boolean
True is a...
integer
real
string
boolean
x is equal to 15; y is equal to 15
x is equal to 5; y is equal to 10
x is equal to 15; y is equal to 10
x is equal to "x + 5"; y is equal to "x"
x is equal to 10, 15; y is equal to 5, 10
All done.
Inside the If.
Inside the if.
All done.
Inside the else.
All done.
Inside the if.
Inside the else.
All done.
3
6
10
18
It will be different each time you run it
makes a and b equal to each other
this code doesn't do anything
rearranges the variables a, b, and tmp.
swaps the values of a and b
This program causes an error
y + z + " and " + x
sentence
BoysHello Girls
Hello Boys and Girls
Hello Girls and Boys
Inside first if
Inside second if
Inside first if
Inside second if
Nothing will be printed
It will be different each time
5
10
55
Nothing is printed
this script would cause an error
9
21
81
nothing is printed
this script would cause an error
Returns the largest of three numbers
Set all three inputs to a temporary value
Return the smallest of the three numbers
Randomly returns on of the three numbers
This code will cause an error
Under 40
And under 21
And contains a 3
Under 40
And contains a 3
Under 40
And under 21
And contains a 3
The word is too short!
The word is too long!
The word is just right!
The word is still too short
The word is just right!
The word is still too short
apple
apple
apple
orange
orange
orange
apple
orange
apple
orange
apple
orange
apple
orange
Nothing will be printed
It will be different each time you run it
0
1
5
10
"here" will displayed over and over until the code is stopped manually
in func1
in func2
func1
func2
in func1
in func2
in func1
DISPLAY in func1
DISPLAY in func2
Nothing is printed
in func3
in func3
in func1
in func3
in func1
in func3
in func3 will be displayed over and over until the code is stopped manually
in func3
in func1
func3
func1
x is equal to 8; y is equal to 8; z is equal to 12
x is equal to 8; y is equal to 4; z is equal to 84
x is equal to 8; y is equal to 8; z is equal to 16
x is equal to 8; y is equal to 8; z is equal to "x + y"
x is equal to 8; y is equal to 4, 8; z is equal to 12
displays true if the number 100 is in the list
displays true if the first number in the list is 100
displays true if the last number in the list is 100
displays true if there are 100 numbers in the list
displays true or false 100 times
x is equal to "yes"; y is equal to "maybe"; z is equal to "no"
x is equal to "no"; y is equal to "maybe"; z is equal to "yes"
x is equal to "no"; y is equal to "maybe"; z is equal to "x"
x is equal to "yes, no"; y is equal to "yes, maybe"; z is equal to "yes, no"
x is equal to "no"; y is equal to "maybe"; z is equal to "no"
Answer
Makes sure the value of x is not equal to 10
Makes sure the value of x is less than 5
Makes sure the value of x is between 10 and 5
It always sets x equal to 5
This code will cause an error
