wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

ITX202 Programming Practice

Total questions: 85

Worksheet time: 1hrs 25mins

Name
Class
Date
1.
Loops are used to repeat parts of a program
a)
True
b)
False
2.
Which of the following is not a type of loop?
a)
IF
b)
Input
c)
Str
d)
Else
3.
Iteration is an alternative term for loop.
a)
True
b)
False
4.
A WHILE loop is an example of a count-controlled loop.
a)
False
b)
True
5.
Which of the following is a count-controlled loop?
a)
FOR
b)
Else
c)
If
d)
Int
6.
A REPEAT loop will always execute at least once.
a)
True
b)
False
7.
A WHILE loop will always execute at least once.
a)
False
b)
True
8.
What is used to control if a loop should run or not?
a)
Condition
b)
If
c)
Else
d)
Fitness
9.
Which is the correct form of a FOR loop in pseudocode?
a)
FOR i=0 TO 10
b)
If i=0 To 10
c)
Else i=0 To 10
10.
Which of the following loops will stop when x reaches 10?
a)
WHILE x < 10
b)
WHILE x < 9
c)
WHILE x < 1
d)
WHILE x < 4
11.
Variables and constants in programs need to be assigned a data type.
a)
True
b)
False
12.
What data type would be best used to record the number of people at a party?
a)
Integer
b)
Real
c)
String
d)
Boolean
13.
What data type would be best to record the exact length of a piece of string in meters?
a)
Real
b)
Boolean
c)
Decimal
d)
Integer
14.
Expressions cannot contain variables of different data types.
a)
False
b)
True
15.
Integers cannot store negative numbers.
a)
False
b)
True
16.
If you store a smaller number in an integer, (say 10 instead of 1234,) it will take up less memory.
a)
False
b)
True
17.
Data types of variables can never be changed.
a)
False
b)
True
18.
What data type would be best used to record an email address?
a)
String
b)
Integer
c)
Real
d)
Character
19.
What data type would be the answer to the expression x < 5?
a)
Boolean
b)
Character
c)
Real
d)
String
20.
Repeating section of code to simplify a solution
a)
Code
b)
Loops
c)
Program
d)
Bugs
21.
A person who writes code and communicates instructions to a computer.
a)
Code
b)
Programmer
c)
Command
d)
Program
22.
Order of events, commands carried by a computer exactly as they are written to run properly.
a)
Sequence
b)
Bugs
c)
Syntax
d)
Debugging
23.
A sequence of logical instructions or steps needed to finish a task.
a)
Bugs
b)
Loops
c)
Algorithm
24.
A sequence of instructions written in a code that a computer can interpret and execute.
a)
Program
b)
Syntax
c)
Programmer
25.
Errors, or mistakes, in the syntax of a programming language.
a)
Program
b)
Bugs
c)
Loops
d)
Code
26.
The spelling and grammar of a programming language.
a)
Syntax
b)
Program
c)
Loops
d)
Command
27.
Language written to communicate with computers, language that gives instructions to computers.
a)
Loops
b)
commands
c)
Bugs
d)
Code
28.
specific instruction given to a computer in written code from a programmer.
a)
Bugs
b)
Command
c)
Syntax
29.
Process of finding and fixing errors in the syntax so the computer program will run properly
a)
Bugs
b)
Sequence
c)
Debugging
d)
Command
30.
What is a good name for this?
a)
cmbFirstName
b)
txtFirstName
c)
textfirstname
d)
frmFirstName
31.
What data type should alLength be?
a)
nvarchar(10)
b)
money
c)
int
d)
dateTime
32.

What is the only thing that computers understand?

a)

Machine Code

b)

Low Level Language

c)

High Level Language

d)

Algorithm

33.

Before a computer can understand a program it must be...

a)

Translated into its machine code.

b)

Translated into a high level language.

c)

Translated into a low level language.

34.

Java, Python, PHP, and C++ are examples of

a)

low level languages

b)

Graphic arts languages

c)

medium level languages

d)

high level languages

35.

It is the process of creating a sequence of instruction to enable computer to do something.

a)

Coding

b)

Programming

c)

Algorithm

36.
What is the correct definition of an algorithm?
a)
An algorithm is a step by step instructions to solve a problem.
b)
An algorithm is a process of baking bread.
c)
An algorithm is a software used to compute numbers.
d)
An algorithm is the process of breaking problems.
37.
What is a flowchart?
a)
A textual representation of algorithms.
b)
A graphical representation of algorithms.
c)
A cluster of different shapes.
d)
A program code written in Logo.
38.

Which of these is the process of typing a series of instructions to have a computer perform a task?

a)

programming

b)

computing

c)

composing

d)

creating

39.

Which of these is the set of rules that must be followed when typing code using a programming language?

a)

Syntax

b)

Value

c)

Expression

d)

Statement

40.

Which of these is a series of instructions that solve a problem?

a)

Algorithm

b)

String

c)

Array

d)

Statement

41.
How would would you print a text string?
a)
output "Hello!"
b)
print "Hello!"
c)
print (Hello!)
d)
output (Hello!)
42.

What should be considered when designing an algorithm?

a)

If there is more than one way of solving the problem

b)

If the correct hardware is being used

c)

If the correct software is being used

43.

What are the two main ways that algorithms can be designed?

a)

Images or videos

b)

In pseudocode or as a flowchart

c)

By hardware or software

44.

What is pseudocode?

a)

A way of describing a set of instructions in text form

b)

A specific programming language that all computers use

c)

A diagrammatic representation of a set of instructions

45.

What is a flowchart?

a)

A flowchart is a text-based way of designing an algorithm

b)

A flowchart is a specific programming language

c)

A flowchart is a diagram that represents a set of instructions

46.

What is the symbol for a decision in a flowchart?

a)

A parallelogram

b)

A diamond

c)

A circle

47.

Which of these is the correct symbol for a process in a flowchart?

a)

A diamond

b)

A rectangle

c)

A parallelogram

48.

How are symbols connected together in a flowchart?

a)

Symbols do not get connected together in a flowchart

b)

With lines and an arrow to show the direction of flow

c)

By numbers

49.

Which symbol is used for a connector in a flowchart?

a)

A parallelogram

b)

A diamond

c)

A circle

50.

When can algorithms be used?

a)

Only with computers

b)

To design a solution to any problem

c)

For programming

51.

What is important to remember when designing an algorithm?

a)

whether to use a flowchart or pseudocode

b)

the instructions are in the correct order

c)

that it must be easy to read

52.
What is this symbol used for in a flowchart?
a)
A decision/question
b)
A task to carry out
53.
What's missing from this part of a flowchart?
a)
An Arrow
b)
A Line
c)
A Square
d)
A Diamond
54.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
55.
On a flowchart, a decision will always have:
a)
Two exit arrows
b)
One exit arrow
c)
Three exit arrows
d)
Four exit arrows
56.
When planning an algorithm using flowcharts, you can use any symbols you'd like.
a)
False
b)
True
57.

A boolean is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

58.

An integer is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

59.

A real is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

60.

The best data type for an age is...

a)

integer

b)

real

c)

string

d)

boolean

61.

The best data type for a name is...

a)

integer

b)

real

c)

string

d)

boolean

62.

The best data type for an average is...

a)

integer

b)

real

c)

string

d)

boolean

63.

The best data type for a counter is...

a)

integer

b)

real

c)

string

d)

boolean

64.

8.2 is a...

a)

integer

b)

real

c)

string

d)

boolean

65.

2.0 is a...

a)

integer

b)

real

c)

string

d)

boolean

66.

True is a...

a)

integer

b)

real

c)

string

d)

boolean

67.
a)

x is equal to 15; y is equal to 15

b)

x is equal to 5; y is equal to 10

c)

x is equal to 15; y is equal to 10

d)

x is equal to "x + 5"; y is equal to "x"

e)

x is equal to 10, 15; y is equal to 5, 10

68.
a)

All done.

b)

Inside the If.

c)

Inside the if.

All done.

d)

Inside the else.

All done.

e)

Inside the if.

Inside the else.

All done.

69.
a)

3

b)

6

c)

10

d)

18

e)

It will be different each time you run it

70.
a)

makes a and b equal to each other

b)

this code doesn't do anything

c)

rearranges the variables a, b, and tmp.

d)

swaps the values of a and b

e)

This program causes an error

71.
a)

y + z + " and " + x

b)

sentence

c)

BoysHello Girls

d)

Hello Boys and Girls

e)

Hello Girls and Boys

72.
a)

Inside first if

b)

Inside second if

c)

Inside first if

Inside second if

d)

Nothing will be printed

e)

It will be different each time

73.
a)

5

b)

10

c)

55

d)

Nothing is printed

e)

this script would cause an error

74.
a)

9

b)

21

c)

81

d)

nothing is printed

e)

this script would cause an error

75.
a)

Returns the largest of three numbers

b)

Set all three inputs to a temporary value

c)

Return the smallest of the three numbers

d)

Randomly returns on of the three numbers

e)

This code will cause an error

76.
a)

Under 40

b)

And under 21

c)

And contains a 3

d)

Under 40

And contains a 3

e)

Under 40

And under 21

And contains a 3

77.
a)

The word is too short!

b)

The word is too long!

c)

The word is just right!

d)

The word is still too short

e)

The word is just right!

The word is still too short

78.
a)

apple

apple

apple

orange

orange

orange

b)

apple

orange

c)

apple

orange

apple

orange

apple

orange

d)

Nothing will be printed

e)

It will be different each time you run it

79.
a)

0

b)

1

c)

5

d)

10

e)

"here" will displayed over and over until the code is stopped manually

80.
a)

in func1

in func2

b)

func1

func2

c)

in func1

in func2

in func1

d)

DISPLAY in func1

DISPLAY in func2

e)

Nothing is printed

81.
a)

in func3

in func3

in func1

b)

in func3

in func1

in func3

c)

in func3 will be displayed over and over until the code is stopped manually

d)

in func3

in func1

e)

func3

func1

82.
a)

x is equal to 8; y is equal to 8; z is equal to 12

b)

x is equal to 8; y is equal to 4; z is equal to 84

c)

x is equal to 8; y is equal to 8; z is equal to 16

d)

x is equal to 8; y is equal to 8; z is equal to "x + y"

e)

x is equal to 8; y is equal to 4, 8; z is equal to 12

83.
a)

displays true if the number 100 is in the list

b)

displays true if the first number in the list is 100

c)

displays true if the last number in the list is 100

d)

displays true if there are 100 numbers in the list

e)

displays true or false 100 times

84.
a)

x is equal to "yes"; y is equal to "maybe"; z is equal to "no"

b)

x is equal to "no"; y is equal to "maybe"; z is equal to "yes"

c)

x is equal to "no"; y is equal to "maybe"; z is equal to "x"

d)

x is equal to "yes, no"; y is equal to "yes, maybe"; z is equal to "yes, no"

e)

x is equal to "no"; y is equal to "maybe"; z is equal to "no"

Answer

85.
a)

Makes sure the value of x is not equal to 10

b)

Makes sure the value of x is less than 5

c)

Makes sure the value of x is between 10 and 5

d)

It always sets x equal to 5

e)

This code will cause an error