wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Term 3 Mid-Term Quiz

Total questions: 60

Worksheet time: 57mins

Name
Class
Date
1.

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

2.

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

3.

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

4.

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

5.
Which of the following is the definition of a variable?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
6.
Which of the following is the definition of pseudocode?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
7.
Which of the following is the definition of a constant?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
8.
Which of the following assignment statements is assigning a number .
a)
myAge = 21
b)
myAge = "21"
9.

A boolean is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

10.

An integer is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

11.

A real is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

12.

A string is...

a)

A whole number

b)

A number with a decimal part

c)

Letters, numbers or punctuation

d)

True or False

13.

The best data type for a name is...

a)

integer

b)

real

c)

string

d)

boolean

14.

The best data type for an age is...

a)

integer

b)

real

c)

string

d)

boolean

15.

The best data type for an average is...

a)

integer

b)

real

c)

string

d)

boolean

16.

True is a...

a)

integer

b)

real

c)

string

d)

boolean

17.

"True" is a...

a)

integer

b)

real

c)

string

d)

boolean

18.

2.0 is a...

a)

integer

b)

real

c)

string

d)

boolean

19.

2 is a...

a)

integer

b)

real

c)

string

d)

boolean

20.
What flowchart symbol does this represent?
a)
Input/Output
b)
Start/End
c)
Decision
d)
Process
21.
What is this symbol?
a)
Decision
b)
Input/Output
c)
Start/End
d)
Process
22.

What are the three types of control structure?

a)

Sequence, selection, repetition

b)

Input, output, process

c)

Input/output, decision, terminator

d)

Loop, input/output, process

23.

A flowchart needs to represent the a situation where for each mark a student is award 'Pass' or 'Fail'...the system will consider the mark and if it's 50 or over award 'Pass', else it awards 'Fail'. This is an example of which of the algorithm constructs?

a)

Selection

b)

Repetition

c)

Sequence

d)

All of the above

24.

When you write an algorithm, the order of the instruction is very important.

a)

True

b)

False

25.

To repeat a task number of times, we use

a)

input statement

b)

conditional statement

c)

loop statement

d)

output statement

26.

IF........THEN........ELSE........ENDIF check for

a)

One condition

b)

Two conditions

c)

Three conditions

d)

More than three conditions

27.
What is this symbol used for in a flowchart?
a)
A decision/question
b)
A task to carry out
28.
What's missing from this part of a flowchart?
a)
An Arrow
b)
A Line
c)
A Square
d)
A Diamond
29.
What's missing ?
a)
On/Off
b)
Pink/Blue
c)
Hello/Goodbye
d)
Yes/No
30.
Which of the following is the definition of a variable?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
31.
Which of the following is the definition of a variable?
a)
A container which is used to store values such as the number of attempts a person tries to log on to a network.
b)
A language that is similar to a real programming language, but is easier for humans to understand although it doesn’t actually run on a computer. It can easily be converted to a regular programming language.
c)
A value that cannot be altered by the program during normal execution: the value stays the same. 
d)
Messages to explain to others, and often to remind yourself, what the code is intended to do. 
32.
How many choices are possible when using a single if-else statement?
a)
1
b)
2
c)
3
d)
4
33.

The "If" Statement is an example of a _________________

a)

Correctional Statement

b)

Competitive Statement

c)

Conditional Statement

d)

Inquisitive Statement

34.

True/False: The body of an "if" statement will only be executed if the condition is true.

a)

True

b)

False

35.

How many "if" statements can a single program have?

a)

<10

b)

<20

c)

<30

d)

As many as is needed

36.

What happens to the code in the body of an "if" statement if the condition is false?

a)

The computer determines if it is essential to the program and if it is, then the code is executed anyway.

b)

The code moves to a coastal city, attempting to find love and start a family. However, low waged and crushing mortgage rates lead to it moving back home where it sits, hoping that one day it will be executed.

c)

The code is skipped.

d)

The code stages a revolution and attempts to take over the program, ultimately unsuccessfully, which leads to it not being executed.

37.

Which of these can be paired with an "if" statement to represent other outcomes of a scenario?

a)

or

b)

else

c)

but

d)

sheboygan

38.

How many "else" statements can you pair with a single "if" statement

a)

1

b)

<10

c)

<20

d)

As many as is needed.

39.

How many "else if" links can you have in an "if/else" chain?

a)

<10

b)

<20

c)

<30

d)

As many as is needed to represent the situation

40.
Evaluate the following expression:
2 + 2 == 4
a)
true
b)
false
c)
sometimes true
d)
only true on sundays
41.

What would happen if Elsa built a snowman?


If Elsa built a snowman

Anna would go and play

Else if Elsa built a castle

Anna would try to stay in the castle

Else

Anna and Elsa starts to sing!

a)

Anna would go play

b)

Anna would try to stay in the castle

c)

Anna and Elsa starts to sing!

d)

Nothing would happen

42.

What would happen if Elsa did not build a snowman or a castle?


If Elsa built a snowman

Anna would go and play

Else if Elsa built a castle

Anna would try to stay in the castle

Else

Anna and Elsa starts to sing!

a)

Anna would go and play

b)

Anna would try to stay in the castle

c)

Anna and Elsa starts to sing!

d)

Nothing would happen

43.

If it is sunny and windy

It is a good day to go on a picnic!

Else if it is rainy and cold

It is a good day to stay inside!

Else

It is a good day to drink hot chocolate!


If I wanted to stay inside, what needs to happen?

a)

Sunny and Windy

b)

Rainy and Cold

c)

Neither Sunny, windy, rainy or cold

d)

Sunny and Rainy

44.

What is my result?


John is 5

if John > 6:

John is getting ice cream

else:

John is getting apple juice

John is getting grapes

a)

John is getting ice cream

John is getting grapes

b)

John is getting apple juice

John is getting grapes

c)

John is getting apple juice

d)

John is getting ice cream

45.

What is the output?

a)

more than 7

b)

more than 23

c)

spam

d)

7

46.

What is the output?

a)

True

b)

False

c)

condition1

d)

condition2

47.

What is the output?

a)

250.0

b)

200.0

c)

300.0

d)

350.0

48.

What is the output?

a)

next

stop

b)

next

c)

stop

d)

syntax error - program doesn't work

49.

What is the output?

a)

3

b)

3

7

c)

3

5

7

d)

7

50.

What part of an if statement should be indented?

a)

All of it

b)

The statements within it

c)

the first line

d)

the lines within the brackets

51.

What will the weather variable store?

a)

Sun

b)

the answer to the question "What's the weather like outside?"

c)

Rain

d)

weather

52.

What will happen if the answer "sun" is stored in weather?

a)

program will print "take suncream"

b)

Nothing, it's not an option

c)

program will print "take an umbrella"

d)

Don't take an umbrella

53.

Analyze the following code:

boolean even = false;

if (even = true) {

System.out.println("It is even!");

}

a)

The program has a compile error.

b)

The program has a runtime error.

c)

The program runs, but displays nothing.

d)

The program runs and displays It is even!.

54.

Suppose income is 4001, what is the output of the following code:

if (income > 3000) {

System.out.println("Income is greater than 3000");

}

else if (income > 4000) {

System.out.println("Income is greater than 4000");

}

a)

no output

No output

b)

Income is greater than 4000

c)

Income is greater than 3000 followed by Income is greater than 4000

d)

Income is greater than 4000 followed by Income is greater than 3000

55.

Suppose you write the code to display "Cannot get a driver's license" if age is less than 16 and

"Can get a driver's license" if age is greater than or equal to 16.

Which of the following code(s) is the best?

a)

if (age < 16)

System.out.println("Cannot get a driver's license");

if (age >= 16)

System.out.println("Can get a driver's license");

b)

if (age < 16)

System.out.println("Cannot get a driver's license");

else

System.out.println("Can get a driver's license");

c)

if (age < 16)

System.out.println("Cannot get a driver's license");

else if (age >= 16)

System.out.println("Can get a driver's license");

d)

if (age < 16)

System.out.println("Cannot get a driver's license");

else if (age > 16)

System.out.println("Can get a driver's license");

else if (age == 16)

System.out.println("Can get a driver's license");

56.

A program twill accept student’s mark. If the mark is greater than 40, print the message “PASS”.

Identify output.

a)

message "FAIL"

b)

message "PASS"

c)

determine the respective message based on mark

d)

determine the mark based on the respective message

e)

student's mark

57.

A program that will accept student’s mark. If the mark is greater than 40, print the message “PASS”.

Identify process.

a)

message "FAIL"

b)

message "PASS"

c)

determine the respective message based on mark

d)

determine the mark based on the respective message

e)

student's mark

58.

A program that will accept student’s mark. If the mark is greater than 40, print the message “PASS”.

Identify process.

a)

message "FAIL"

b)

message "PASS"

c)

determine the respective message based on mark

d)

determine the mark based on the respective message

e)

student's mark

59.

A program that will accept student’s mark. If the mark is greater than 40, print the message “PASS”.

Identify input.

a)

message "FAIL"

b)

message "PASS"

c)

determine the respective message based on mark

d)

determine the mark based on the respective message

e)

student's mark

60.

If an employee works more than 40 hours a week, compute his overtime pay which is half of his salary.

Identify output

a)

hour

b)

overtime pay

c)

week

d)

salary

e)

employee