Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

IG2 Exam - U4 Advanced Programming(with glossary)

Total questions: 101

Worksheet time: 1hrs 27mins

Name
Class
Date
1.

an operator that is used to perform calculations

(a)  

2.

a data structure containing several elements of the same data type; these elements can be accessed using the same identifier name

(a)  

3.

an operator that is used with logical operators to form more complex expressions

(a)  

4.

a variable or constant that is a single character

(a)  

5.

a named data store that contains a value that does not change during the execution of a program

(a)  

6.

keeping track of the number of times an action is performed

(a)  

7.

define the value and data type of a variable or constant

(a)  

8.

an arithmetic operator that returns the quotient (whole number part) of a division; different languages use different symbols for this operation

(a)  

9.

a collection of data stored by a computer program to be used again

(a)  

10.

a set of programming statements grouped together under a single name which can be called to perform a task in a program, rather than including a copy of the code every time; just like a procedure except a function will return a value back to the main program

(a)  

11.

identifies the position of an element in an array

(a)  

12.

a positive or negative whole number that can be used with mathematical operators

(a)  

13.

a section of programming code that can be repeated under certain conditions

(a)  

14.

an operator that is used to decide the path to take through a program if the expression formed is true or false

(a)  

15.

an arithmetic operator that returns the remainder of a division; different languages use different symbols for this operation

(a)  

16.

the inclusion of one type of code construct inside another

(a)  

17.

a special character or word in a programming language that identifies an action to be performed

(a)  

18.

the variables in a procedure or function declaration that store the values of the arguments passed from the main program to the procedure or function

(a)  

19.

a set of programming statements grouped together under a single name which can be called to perform a task in a program, rather than including a copy of the code every time the task is performed

(a)  

20.

a library routine that generates a random number

(a)  

21.

a positive or negative number with a fractional part; real numbers can be used with mathematical operators

(a)  

22.

a library routine that rounds a value to a given number of decimal places

(a)  

23.

allowing the selection of different paths through the steps of a program

(a)  

24.

the order in which the steps in a program are executed

(a)  

25.

a variable or constant that is several characters in length; strings vary in length and may even have no characters (an empty string); the characters can be letters and/or digits and/or any other printable symbol

(a)  

26.

keeping a total that values are added to

(a)  

27.

a named data store than contains a value that may change during the execution of a program

(a)  

28.

an SQL command that counts the number of records (rows) in which the field (column) matches a specified condition; used with SELECT

(a)  

29.

a classification of how data is stored and displayed, and of which operations can be performed on the stored value

(a)  

30.

a persistent structured collection of data that allows people to extract information in a way that meets their needs

(a)  

31.

a single item of data in a record, stored in a database table

(a)  

32.

an SQL command that identifies the table to use full-duplex data that can be sent in both directions at the same time (simultaneously)

(a)  

33.

an SQL command that sorts the results from a query by a given column, either alphabetically or numerically

(a)  

34.

a field in a database that uniquely identifies a record

(a)  

35.

a field in a database that uniquely identifies a record

(a)  

36.

a SQL command that fetches specified fields (columns) from a table

(a)  

37.

a database that contains only one table

(a)  

38.

a list of SQL commands that perform a given task, often stored in a file so the script can be reused

(a)  

39.

the standard query language for writing scripts to obtain useful information from a relational database

(a)  

40.

an SQL command that returns the sum of all the values in a field (column); used with SELECT

(a)  

41.

a collection of related records in a database

(a)  

42.

a collection of related records in a database

(a)  

43.

a form of algebra linked to logic circuits and based on TRUE or FALSE

(a)  

44.

this is formed from a combination of logic gates and designed to carry out a particular task; the output from a logic circuit will be 0 or 1

(a)  

45.

an electronic circuit that relies on ‘on/off’ logic; the most common gates are NOT, AND, OR, NAND, NOR and XOR

(a)  

46.

a method of checking the output from a logic circuit; a truth table lists all the possible binary input combinations and their associated outputs; the number of outputs will depend on the number of inputs; for example, two inputs have 22 (4) possible binary combinations, three inputs have 23 (8) possible binary combinations, and so on

(a)  

47-61.
47.

What is a database?

a)

A collection of data that allows people to extract information

b)

A type of computer program

c)

A social media platform

d)

A video game console

48.

What is a single-table database?

a)

A database with only pictures

b)

A database with no tables

c)

A database with multiple tables

d)

A database with only one table

49.

What is a primary key in a database?

a)

A field that is not important

b)

A field that uniquely identifies a record

c)

A field that contains duplicate values

d)

A field that is optional

50.

What is SQL used for?

a)

Writing scripts to obtain information from a database

b)

Creating social media profiles

c)

Playing video games

d)

Sending emails

51.

Why can't any field in the StudentRoom database be used as a primary key?

a)

All fields are numbers

b)

All fields are too long

c)

All fields are empty

d)

All fields contain duplicate values

52.

Which field could be added as a primary key in the StudentRoom database?

a)

StudentID

b)

Name

c)

Block

d)

RoomNumber

53.

What is the output of the SQL command: SELECT * FROM StudentRoom WHERE Block = 'A' ORDER BY RoomNumber;

a)

Block A, Amy Tang, 123, David Chow, 129, David Smith, 129, Adel Hoo, 125

b)

Block A, Adel Hoo, 125, Amy Tang, 123, David Chow, 129, David Smith, 129

c)

Block B, Ben Lee, 130, Cindy Wong, 131, Emma Chen, 132

d)

Block A, David Smith, 129, Adel Hoo, 125, Amy Tang, 123, David Chow, 129

54.

Which field could be used as a primary key in the StudentRoom database?

a)

Name

b)

Block

c)

StudentID

d)

RoomNumber

55.

What is the purpose of a primary key in a database?

a)

To confuse users

b)

To duplicate values in a table

c)

To uniquely identify each record

d)

To add unnecessary data

56.

What is the structure of a single-table database?

a)

Consists of no tables

b)

Consists of multiple tables with one record each

c)

Consists of one table with many records

d)

Consists of only pictures

57.

What are the basic data types in a database used for?

a)

Playing music

b)

Drawing pictures

c)

Writing stories

d)

Classifying how data is stored and displayed

58.

What is the purpose of Structured Query Language (SQL)?

a)

Creating video games

b)

Posting on social media

c)

Sending text messages

d)

Writing scripts to obtain information from a database

59.

What is the role of a primary key in a database table?

a)

Uniquely identifying each record

b)

Repeating values in a table

c)

Confusing users

d)

Adding unnecessary data

60.

What is the purpose of a data type in a database?

a)

Classifying how data is stored, displayed, and operations that can be performed

b)

Classifying how data is stored and displayed

c)

Classifying how data is stored and operations that can be performed

d)

Classifying how data is displayed and operations that can be performed

61.

What is the standard query language for writing scripts to obtain information from a database?

a)

JavaScript

b)

Structured Query Language (SQL)

c)

HTML

d)

Python

62.

What term is used to describe data passed into/out of a program?

a)

Variable

b)

Loop

c)

Constant

d)

Parameter

63.

Leo wants to create a subroutine that will roll a dice. Which syntax is correct?

a)

def dice roll ():

b)

def diceroll ()

c)

def diceroll ():

d)

def diceroll []:

64.

What would the output be from the program shown here? (assuming that the user enters "John" and "Smith"

a)

John

b)

Smith

c)

John Smith

d)

Error

65.
What is a procedure?
a)
A small section of code within a program which performs a task
b)
Code which produces a calculated result
66.

If a variable has "global scope" it can be

a)

used anywhere in the program

b)

only used outside of a function

c)

only used inside of a function

d)

used outside of the program

67.

If a variable has "local scope" it is available for use outside of its function.

a)

TRUE

b)

FALSE

68.
What will print?
a)
nothing
b)
5
c)
6
d)
an error message
69.
How many times will Boo print?
a)
none
b)
4
c)
5
d)
1
70.
What will print?
a)
1 2
b)
1
c)
3
d)
5
71.

What will be the output of this program if the user enters "Han" and then "Solo"?

a)

An error

b)

Nothing

c)

first surname

d)

Han Solo

72.
How do you correctly call this function
a)
def(1)
b)
x=square( )
c)
defSquare(4)
d)
x=square(5)
73.

A function with 2 integer parameters could start with which definition?

a)

funct addNumbers(num1, num2):

b)

def addNumbers(num1, num2):

c)

def 2Numbers(num1, num2):

d)

FUNCTION addNumbers(x, y):

74.

The values that a program provides to a function or subroutine in the calling stage.

a)

loop

b)

procedure

c)

argument

d)

conditional

e)

parameter

75.

The values that a program provides to a function or subroutine in the defining stage.

a)

loop

b)

procedure

c)

argument

d)

conditional

e)

parameter

76.

x, y are the ​ (a)   of the procedure "study", whilst 1, 2 are the ​ (b)   of the procedure "study"

Choose from the below words
parameters
arguments
77.

Which of the following is an advantage of using local variables?

a)

They allow the variable to be used throughout the whole program

b)

They allow variable identifiers to be reused each time

c)

They are easier to program than global variables

d)

A wider range of data types can be used

78.

What is a constant?

a)

A named data store that contains a value that does not change during the execution of a program

b)

A special symbol or word in a programming language that identifies an action to be performed

c)

A named data store that contains a value that may change during the execution of a program

d)

A positive or negative whole number that can be used with mathematical operators

79.

What is a variable?

a)

A special character or word in a programming language that identifies an action to be performed

b)

A positive or negative whole number that can be used with mathematical operators

c)

A named data store that contains a value that does not change during the execution of a program

d)

A named data store that contains a value that may change during the execution of a program

80.

What is an array?

a)

A set of programming statements grouped together under a single name that can be called to perform a task in a program

b)

A positive or negative whole number that can be used with mathematical operators

c)

A data structure containing several elements of the same data type

d)

A variable or constant that is several characters in length

81.

What is the main reason for using a procedure in programming?

a)

To save and retrieve data from a magical book

b)

To perform calculations using wizardry

c)

To declare, use, and manipulate different types of wands and spells

d)

To group spells together under a single spellbook that can be called to perform a task in a program

82.

What is the main purpose of a function in programming?

a)

To group programming statements together under a single name that can be called to perform a task in a program

b)

To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions

c)

To perform calculations using arithmetic operators

d)

To store data in a file and retrieve data from a file

83.

What is the purpose of the MOD operator in programming?

a)

To find the magical remainder of a division

b)

To uncover the hidden quotient (whole number part) of a division

c)

To perform a mystical rounding of a value to a given number of decimal places

d)

To conjure a random number

84.

What does the DIV operator do in programming?

a)

To generate a random number

b)

To round a value to a given number of decimal places

c)

To return the quotient (whole number part) of a division

d)

To return the remainder of a division

85.

What is the purpose of the ROUND library routine in programming?

a)

To generate a random number

b)

To return the quotient (whole number part) of a division

c)

To return the remainder of a division

d)

To round a value to a given number of decimal places

86.

What is the purpose of the RANDOM library routine in programming?

a)

To return the remainder of a division

b)

To generate a random number

c)

To return the quotient (whole number part) of a division

d)

To round a value to a given number of decimal places

87.

What is the purpose of the AND operator in programming?

a)

To perform logical AND operation on two boolean values

b)

To combine two numbers together

c)

To multiply two numbers

d)

To divide two numbers

88.

What is the purpose of the NOT operator in programming?

a)

To reverse the value of a boolean variable

b)

To perform addition of two numbers

c)

To perform division of two numbers

d)

To perform multiplication of two numbers

89.

What is the purpose of the XOR operator in programming?

a)

To perform exclusive OR operation on two boolean values

b)

To combine two numbers together

c)

To multiply two numbers

d)

To divide two numbers

90.

What is the main purpose of a subroutine in programming?

a)

To group programming statements together under a single name that can be called to perform a task in a program

b)

To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions

c)

To perform calculations using arithmetic operators

d)

To store data in a file and retrieve data from a file

91.

In the Python code, greeting is an example of a ​ (a)   ​ because it ​ (b)   have a return value.

greeting has one ​​ (c)   called name.

Inside greeting, there is a variable called message. This is an example of a ​ (d)   variable because message can not be accessed from outside greeting.

Choose from the below words
function
does
parameter
local
global
does not
procedure
92.

a = true, b = true, c = false

x = not((a and b) and (b or c))​

The final value of x is ​ (a)  

Choose from the below words
false
true
93.

Match the following

a)

open("file.txt", w)

1.

Create a new empty file and then add data

b)

open("file.txt", a)

2.

Append data to an existing file

c)

open("file.txt", r)

3.

Read data from an existing file

94.

Label the following logic gates

95.

An SQL command that counts the number of records (rows) in which the field (column) matches a specified condition; used with SELECT (a)  

Choose from the below words
ORDER BY
COUNT
SUM
WHERE
96.

A classification of how data is stored and displayed, and of which operations that can be performed on the stored value

a)

data type

b)

data value

c)

data

d)

data packet

97.

A persistent structured collection of data that allows people to extract information in a way that meets their needs

a)

record

b)

table

c)

database

d)

basedata

98.

The values associated with each record in a database table

a)

table

b)

record

c)

primary key

d)

field

99.

An SQL command that identifies the table to use

a)

SELECT

b)

FROM

c)

WHERE

d)

ORDER BY

100.

An SQL command that sorts the results from a query by a given column either alphabetically or numerically

a)

SUM

b)

WHERE

c)

COUNT

d)

ORDER BY

101.

A field in a database that uniquely identifies a record

a)

public key

b)

private key

c)

primary key

d)

secondary key

102.

A collection of fields that describe one item

a)

table

b)

record

c)

field

d)

database

103.

An SQL command that fetches specified fields (columns) from a table

a)

SELECT

b)

FROM

c)

WHERE

d)

ORDER BY

104.

A database that contains only one table

a)

object database

b)

graph database

c)

relational database

d)

single-table database

105.

A list of SQL commands that perform a given task, often stored in a file so it can be reused

a)

original scripts

b)

SQL Scripts

c)

storyboard scripts

d)

screenplay scripts

106.

The standard query language for writing scripts to obtain useful information from a relational database

a)

Hypertext Markup Language (HTML)

b)

Data Manipulation Language (DML)

c)

Data Definition Language (DDL)

d)

Standard Query Language (SQL)

107.

An SQL command that returns the sum of all the values in a field (column); used with SELECT

a)

SELECT

b)

SUM

c)

FROM

d)

WHERE

108.

A collection of related records in a database

a)

field

b)

row

c)

table

d)

column

109.

An SQL command to include only those records (rows) in a query that match a given condition

a)

SELECT

b)

FROM

c)

WHERE

d)

ORDER BY

110.

2 < 3 AND (NOT (3>2))

a)

False

b)

True

111.

If x = 3 and y = 5, choose all the statements that evaluate to True.

a)

x < y

b)

2*x == y

c)

x + 2 == y

d)

y*(x - 1) > x

112.

A logic gate that outputs True only if both inputs are True is called...

a)

eXOR

b)

NOT

c)

OR

d)

AND

113.

(1 + 2) >= 3 OR (-(1 + 3)> 5)

a)

TRUE

b)

FALSE

114.

In which of the following logic gates the output is 1 if and only if at least one input is 1?

a)

NOR

b)

AND

c)

NAND

d)

OR

115.

(NOT A) AND B = P


If A = 0 and B = 1, what does P equal?

a)

1

b)

0