wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Principles of Computer Science

Total questions: 110

Worksheet time: 1hrs 19mins

Name
Class
Date
1.
What is computational thinking?
a)
It allows you to break down a large / complex problem into smaller parts.
b)
It is thinking like a robot
c)
It is being able to bake a cake.
d)
It is creating a coding solution to a problem.
2.
What are the three key parts of computational thinking?
a)
Programming, flowcharts and pseudo code
b)
Abstraction, decomposition and algorithm
c)
Input, processing and output
d)
Patterns, shapes and numbers
3.
What is abstraction?
a)
A painting
b)
A programming language
c)
This means focusing on the important details and ignoring the irrelevant information
d)
Abstraction is the breaking down of a big problem into smaller parts.
4.
What does decomposition mean?
a)
focuses on the important information only, ignoring irrelevant detail
b)
Step by step instructions on solving a problem.
c)
Thinking like a computer
d)
This is the breaking down of a complex problem into smaller parts
5.
What is an algorithm?
a)
A sequence of instructions on how to solve a problem.
b)
The breaking down of a problem into smaller parts.
c)
Focusing on important parts and ignoring the irrelevant details
d)
The recipe for a cake
6.
What are the two main ways that we represent an algorithm?
a)
By drawing pictures 
b)
Using flowcharts and pseudo code
c)
Using python and small basic
d)
Using Scratch and python
7.
What is a flowchart?
a)
A visual representation of an algorithm using symbols
b)
Using 'fake code' to plan an algorithm
c)
Using a programming language to show an algorithm
d)
Uisng different types of charts to show an algorithm
8.
What does the following symbol represent in a flowchart?
a)
An input
b)
Start
c)
End
d)
A process
9.
What does the following flowchart symbol represent?
a)
A process
b)
An output
c)
A decision (choice)
d)
End
10.
What does the following flowchart symbol represent?
a)
Input / Output
b)
Start of flowchart
c)
A process
d)
End
11.
What does the following flowchart symbol represent?
a)
Process
b)
Input
c)
Start / End
d)
Sub-process
12.

Define ABSTRACTION

a)

Breaking a task into smaller tasks.

b)

Drawing a map to show how to reach a destination.

c)

Creating step by step instructions.

d)

Focusing on what is important and ignoring what is unnecessary.

13.

Define PATTERN RECOGNITION.

a)

A sequence of instructions.

b)

Looking for similarities and trends.

c)

Breaking a task into smaller tasks.

d)

Focusing on what is important and ignoring what is unnecessary.

14.

Define ALGORITHM DESIGN

a)

Breaking a task into smaller tasks.

b)

Looking for similarities and trends.

c)

A sequence of instructions.

d)

Deciding what computer to use.

15.

What is the OUTPUT if the user enters "YES"?

a)

Leave umbrella at home.

b)

Take an umbrella.

16.

Which of these is an example of decomposition?

a)

Watching a mechanic repair a car

b)

Finding out how a car works by looking in detail at the different parts that make up the car

c)

Looking at different car models for similarities between them

17.

Why do we need to look for patterns in problems?

a)

Patterns make it easier for us to solve complex problems

b)

We don't need to look for patterns

c)

Patterns make it more difficult complex problems

18.

You are building a calculator program that will take in a first number, a second number, add them together and display a result. You need to identify the parts of your system. Identify your two inputs.

a)

Calculator

b)

First number

c)

Display

d)

Second number

e)

Result

19.

You are building a calculator program that will take in a first number, a second number, add them together and display a result. You need to identify the parts of your system. Identify your key processes.

a)

Input a first number

b)

Input a second number

c)

Display a result

d)

Add two numbers together

20.
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.
21.

When a program repeats, looping over the same sequence, it is called...

a)

iteration

b)

a variable

c)

an instruction

22.

Instructions carried out one after another in order is a...

a)

List

b)

Sequence

c)

Collection

d)

Series

23.

Which is the definition of "sequence"?

a)

A set of instructions in a specific order

b)

Where instructions repeat

c)

Code where decisions are made

24.

Which is the definition of "selection"?

a)

A set of instructions in a specific order

b)

Where instructions repeat

c)

Code where decisions are made

25.

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

26.

What is a CHAR datatype?

a)

A datatype that can hold any single character.

b)

A datatype that can hold only numbers.

c)

A datatype that can be ignored.

d)

A datatype that can fit 7.

27.

What is a STRING datatype?

a)

It can store a sequence of numbers.

b)

It can store a sequence of characters.

c)

It can store a sequence of letters.

d)

All of the above.

28.

DISPLAY (17 MOD 5)

a)

0

b)

1

c)

2

d)

4

e)

5

29.

DISPLAY (17 MOD 6)

a)

0

b)

1

c)

2

d)

4

e)

5

30.

DISPLAY (17 MOD 2)

a)

0

b)

1

c)

2

d)

4

e)

5

31.
Variables cannot be changed.
a)
False
b)
True
32.
Constants cannot be changed.
a)
True
b)
False
33.
The value of a constant can be changed using an expression.
a)
False
b)
True
34.
Variable names can't start with a number.
a)
True
b)
False
35.
Variable names can include spaces.
a)
False
b)
True
36.
Some specific words can't be used as variables.
a)
True
b)
False
37.
Which of the following variables names is an example of camel case?
a)
totalScore
b)
TOTALSCORE
c)
TotalScore
38.

A variable is a location in the computer’s memory to hold a piece of data.

a)

TRUE

b)

FALSE

39.

A variable must be named and assigned a datatype in strict programming languages.

a)

TRUE

b)

FALSE

40.

The variable StudentID holds a combination of letters and numbers (e.g.BA001). The datatype of the variable is string.

a)

TRUE

b)

FALSE

41.
<=
a)
less than
b)
less than or equal to
42.
>=
a)
greater than
b)
greater than or equal to
c)
not greater than
d)
not equal to
43.
==
a)
equal to
b)
assign a variable
c)
not equal to
d)
less than
44.
! =
a)
greater than variable
b)
less than variable
c)
equal to
d)
not equal to
45.
3<=4
a)
TRUE
b)
FALSE
46.
45 ! = 2
a)
TRUE
b)
FALSE
47.
What is an automatic computer check to make sure data entered is sensible and reasonable known as?
a)
Double entry
b)
Verification
c)
Validation
48.
What validation type would make sure a post code was entered in the correct format?
a)
Length check
b)
Format check
c)
Presence check
49.
What validation type would you use to check that numbers fell within a certain range?
a)
Range check
b)
Presence check
c)
Check digit
50.
What validation type checks that a field is not left blank?
a)
Format check
b)
Length check
c)
Presence check
51.
What validation type checks a minimum number of characters have been entered?
a)
Length check
b)
Format check
c)
Range check
52.
Data is to be entered into a computer in the format YYMMDD. Which of the following is not a valid date?
a)
310921
b)
211113
c)
21st June 2004
53.
Which of the following statements is false?
a)
Validation can check that the data is sensible
b)
Validation can check that the data falls between certain allowable boundaries
c)
Validation can check that the data is correct
54.
Compares pairs of items and swaps them if they are in the wrong order. Each pair in the list is checked.
a)
Bubble sort
b)
Insertion sort
55.
The process keeps repeating until there are no swaps in a pass.
a)
Bubble sort
b)
Insertion sort
56.
Takes each item in turn and puts it in the right place using the first item in the list as a starting point.
a)
Bubble sort
b)
Insertion sort
57.
Starts by looking at the second item and compares it to all items before it in order to insert it in the right place.
a)
Bubble sort
b)
Insertion sort
58.
Repeats the process for the rest of the items until the last item has been inserted in the correct place.
a)
Bubble sort
b)
Insertion sort
59.
What does a binary search do?
a)
Looks at the first item of data, then each one in turn, until it finds the data item requested
b)
Converts all the data into binary
c)
Takes the data and splits it in half repeatedly until it finds the data item requested
60.
Which search algorithm would be best to use with ordered data?
a)
A binary search
b)
Either binary search or a linear search
c)
A linear search
61.
What is an advantage of a binary search
a)
It's very quick
b)
It only works with ordered lists
c)
It is a simple algorithm
62.
What is the biggest disadvantage of a binary search?
a)
It is slow
b)
It can only be used if the data is sorted into an order
c)
It takes the data and keeps dividing it in half until it finds the item it is looking for
63.
If you have a large amount of data to search through the best algorithm would be a 
a)
Binary Search
b)
Linear Search
64.
Which search algorithm is the easiest to understand?
a)
Binary
b)
Linear
65.
Which search algorithm is more likely to complete the search in fewer steps?
a)
Binary
b)
Linear
66.
Which type of search algorithm is this?
a)
Binary
b)
Linear
67.
Which of the following descriptions best describes a linear search:
a)
Put the elements in order, check each item in turn
b)
Put the elements in order, compare with the middle value, split the list in order and repeat
c)
Elements do not need to be in order, check each item in turn.
d)
Elements do not need to be in order, compare to the middle value, split the list in order and repeat.
68.

Which of the following usees FIFO method

a)

Queue

b)

stack

c)

linklist

d)

binary tree

69.

This form of access is used to add and remove nodes from a queue.

a)

LIFO, Last In First Out

b)

FIFO, First In First Out

c)

Both a and b

d)

none

70.
........ form of access is used to add remove nodes from a stack.
a)
LIFO
b)
Fifo
c)
none
d)
all
71.

Which of the following languages is object oriented?

a)

C

b)

C++

c)

BASIC

d)

Pascal

72.

What are the building blocks of a procedural program?

a)

Objects and Classes

b)

Variables and methods

c)

Procedures and Functions

d)

All of the above

73.

Variables declared outside a function and they can be accessed by any function in the program are..

a)

State Variables

b)

Local Variables

c)

Global Variables

d)

Re-usable Variables

74.

The three types of control structures are

a)

sequential, selection and flexible

b)

sequential, flexible and variable

c)

sequential, selection and repetition

d)

flexible, selection and repetition

75.

Examples of Boolean Operators include

a)

AND (&&)

b)

OR (||)

c)

NOT (!)

d)

All of the above

76.
Which of the following concepts of OOPS means exposing only necessary information to client?
a)
Encapsulation
b)
Abstraction
c)
Data hiding
d)
Data binding
77.
How many objects can be made from a class? 
a)
None, you make classes from objects
b)
one
c)
As many as you want
d)
All of the above
78.
What is the difference between a class and an object?
a)
A class is a blueprint to make an object
b)
An object is a blueprint to make a class
c)
A blueprint is an object to make a class
d)
Blueprint class is an object make a
79.
UI stands for …….
a)
 Uniform Interface
b)
 Uniform Interface
c)
User Interface
d)
None of the above
80.

When pressed, what will a button immediately cause in an event driven language?

a)

Code to be run

b)

Changes to the environment

c)

The user will make a choice and interact with the application

d)

An event to be triggered

81.
Which of the following is the best definition for Event- driven program
a)
 Program designed to run blocks of code or functions in response to specified events (e.g. a mouse click)
b)
Coding tasks involved in making your app respond to events by triggering functions.
c)
Function specified as part of an event listener; it is written by the programmer but called by the system as the result of an event trigger.
d)
A command (onEvent in App Lab) that can be set up to trigger a function when a particular type of event occurs on a particular UI element.
82.

What does HTML stand for?

a)

Hypertext Making Language

b)

Hyper Transfer Markup Language

c)

Hypertext Markup Language

d)

Hyper Transfer Making Language

83.

The <p> tag marks what type of content?

a)

paragraph

b)

heading

c)

hyperlink

d)

picture

84.

Which of these tags mark content with emphasis? (choose 2)

a)

<strong></strong>

b)

<em></em>

c)

<br></br>

d)

<hr></hr>

e)

<p></p>

85.

Which tag is used to create a hyperlink on a web page?

a)

<a>

b)

<link>

c)

<hr>

d)

<img>

86.

Which attribute contains the URL to a linked web page?

a)

href

b)

type

c)

src

d)

name

87.

The <ol> tag is used to mark what type of content?

a)

a numbered list

b)

a bulleted list

c)

an image

d)

a cell in a table

88.

The <ul> tag is used to mark what type of content?

a)

a bulleted list

b)

a numbered list

c)

a line break

d)

a hyperlink

89.

The <img> tag is used to mark what type of content?

a)

graphics

b)

video

c)

hyperlinks

d)

data tables

90.

CSS stands for cascading ________ sheets.

a)

service

b)

style

c)

setup

d)

security

91.

Which tag is used to indicate that everything within them will be visible on the page?

a)

meta

b)

html

c)

img

d)

body

92.

Which of the following is correct for the GET method?

a)

It requests a representation of the specified resource. Requests using it should only retrieve data.

b)

It is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

c)

It establishes a tunnel to the server identified by the target resource.

d)

It is used to apply partial modifications to a resource.

93.

Which of the following is correct for the POST method?

a)

It requests a representation of the specified resource. Requests using it should only retrieve data.

b)

It is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

c)

It asks for a response identical to that of a GET request, but without the response body.

d)

It is used to apply partial modifications to a resource.

94.
What does the H in HTTP stand for?
a)
Hyper
b)
Hypertext
c)
HTML
d)
Helix
95.
What does the S in HTTPS stand for?
a)
Secure
b)
Safe
c)
Standard
d)
Solus
96.
What type of certificate is used for HTTPS?
a)
SSL
b)
FTP
c)
TCP
d)
DNS
97.
What is the difference between HTTP & HTTPS?
a)
One is secured
b)
They are the same
c)
One is used for the web, one is used for calculating temperature
d)
One is a wrong answer
98.
What does Firewall Do?
a)
Prevents Hackers
b)
Install Viruses
c)
Give you SD cards
d)
Blocks all content
99.
Which of the following is a key function of a firewall?
a)
Monitoring
b)
Copying
c)
Moving
d)
Deleting
100.

Firewalls provide protection against outside attackers by shielding your computer or network from malicious or unnecessary network traffic

a)

True

b)

False

101.

What is encryption?

a)

Data is altered to make it easy to read

b)

Transforms data to make it easier to enable hackers to access it

c)

Transform data from one form into another

d)

Data is altered to prevent people from reading it

102.

Original data ready to be encrypted is called

a)

Plaintext

b)

Ciphertext

c)

Cipher

d)

Key

103.

Hashing is ...

a)

The interception of a key that is used to decrypt data

b)

The transformation of a string of characters into a fixed length value or key that represents the original input string

c)

When data from a database is mismanaged

d)

When minor changes in the original string can completely change the hash value

104.

Hashing is ...

a)

Changes data before it reaches the spreadsheet records to be compared to

b)

Is very secure

c)

Is not very secure

d)

Changes data before it reaches the database records to be compared to

105.

Hashing ...

a)

Changes data before it reaches the spreadsheet records to be compared to

b)

Never stores sensitive data as plain text

c)

Is not very secure

d)

Stops hackers being able to see data and they will only see the hashed values

106.

How many times will "Hi" be printed to the console?

a)

1

b)

2

c)

3

107.

What will be printed to the console by this code?

a)

"B", "C", "D"

b)

"A", "B", "C", "D"

c)

"A", "B", "C"

d)

"A", "C", "D"

108.

What will the value of x be AFTER this code is run?

a)

4

b)

2

c)

3

d)

6

109.

What will be printed to the console when this code is run, if the user enters 12?

a)

"Jan"

b)

"Jan", "Feb", "Mar"

c)

"Jan", "Mar"

d)

"Feb", "Mar"

110.

What will be printed to the console when this code is run?

a)

"Yay!", "Boo", "Yippee"

b)

"Yay!", "Yippee"

c)

"Boo", "Yippee"

d)

"Yippee"