WorksheetsIG2 Exam - U4 Advanced Programming(with glossary)
Total questions: 101
Worksheet time: 1hrs 27mins
an operator that is used to perform calculations
(a)
a data structure containing several elements of the same data type; these elements can be accessed using the same identifier name
(a)
an operator that is used with logical operators to form more complex expressions
(a)
a variable or constant that is a single character
(a)
a named data store that contains a value that does not change during the execution of a program
(a)
keeping track of the number of times an action is performed
(a)
define the value and data type of a variable or constant
(a)
an arithmetic operator that returns the quotient (whole number part) of a division; different languages use different symbols for this operation
(a)
a collection of data stored by a computer program to be used again
(a)
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)
identifies the position of an element in an array
(a)
a positive or negative whole number that can be used with mathematical operators
(a)
a section of programming code that can be repeated under certain conditions
(a)
an operator that is used to decide the path to take through a program if the expression formed is true or false
(a)
an arithmetic operator that returns the remainder of a division; different languages use different symbols for this operation
(a)
the inclusion of one type of code construct inside another
(a)
a special character or word in a programming language that identifies an action to be performed
(a)
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)
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)
a library routine that generates a random number
(a)
a positive or negative number with a fractional part; real numbers can be used with mathematical operators
(a)
a library routine that rounds a value to a given number of decimal places
(a)
allowing the selection of different paths through the steps of a program
(a)
the order in which the steps in a program are executed
(a)
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)
keeping a total that values are added to
(a)
a named data store than contains a value that may change during the execution of a program
(a)
an SQL command that counts the number of records (rows) in which the field (column) matches a specified condition; used with SELECT
(a)
a classification of how data is stored and displayed, and of which operations can be performed on the stored value
(a)
a persistent structured collection of data that allows people to extract information in a way that meets their needs
(a)
a single item of data in a record, stored in a database table
(a)
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)
an SQL command that sorts the results from a query by a given column, either alphabetically or numerically
(a)
a field in a database that uniquely identifies a record
(a)
a field in a database that uniquely identifies a record
(a)
a SQL command that fetches specified fields (columns) from a table
(a)
a database that contains only one table
(a)
a list of SQL commands that perform a given task, often stored in a file so the script can be reused
(a)
the standard query language for writing scripts to obtain useful information from a relational database
(a)
an SQL command that returns the sum of all the values in a field (column); used with SELECT
(a)
a collection of related records in a database
(a)
a collection of related records in a database
(a)
a form of algebra linked to logic circuits and based on TRUE or FALSE
(a)
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)
an electronic circuit that relies on ‘on/off’ logic; the most common gates are NOT, AND, OR, NAND, NOR and XOR
(a)
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)
What is a database?
A collection of data that allows people to extract information
A type of computer program
A social media platform
A video game console
What is a single-table database?
A database with only pictures
A database with no tables
A database with multiple tables
A database with only one table
What is a primary key in a database?
A field that is not important
A field that uniquely identifies a record
A field that contains duplicate values
A field that is optional
What is SQL used for?
Writing scripts to obtain information from a database
Creating social media profiles
Playing video games
Sending emails
Why can't any field in the StudentRoom database be used as a primary key?
All fields are numbers
All fields are too long
All fields are empty
All fields contain duplicate values
Which field could be added as a primary key in the StudentRoom database?
StudentID
Name
Block
RoomNumber
What is the output of the SQL command: SELECT * FROM StudentRoom WHERE Block = 'A' ORDER BY RoomNumber;
Block A, Amy Tang, 123, David Chow, 129, David Smith, 129, Adel Hoo, 125
Block A, Adel Hoo, 125, Amy Tang, 123, David Chow, 129, David Smith, 129
Block B, Ben Lee, 130, Cindy Wong, 131, Emma Chen, 132
Block A, David Smith, 129, Adel Hoo, 125, Amy Tang, 123, David Chow, 129
Which field could be used as a primary key in the StudentRoom database?
Name
Block
StudentID
RoomNumber
What is the purpose of a primary key in a database?
To confuse users
To duplicate values in a table
To uniquely identify each record
To add unnecessary data
What is the structure of a single-table database?
Consists of no tables
Consists of multiple tables with one record each
Consists of one table with many records
Consists of only pictures
What are the basic data types in a database used for?
Playing music
Drawing pictures
Writing stories
Classifying how data is stored and displayed
What is the purpose of Structured Query Language (SQL)?
Creating video games
Posting on social media
Sending text messages
Writing scripts to obtain information from a database
What is the role of a primary key in a database table?
Uniquely identifying each record
Repeating values in a table
Confusing users
Adding unnecessary data
What is the purpose of a data type in a database?
Classifying how data is stored, displayed, and operations that can be performed
Classifying how data is stored and displayed
Classifying how data is stored and operations that can be performed
Classifying how data is displayed and operations that can be performed
What is the standard query language for writing scripts to obtain information from a database?
JavaScript
Structured Query Language (SQL)
HTML
Python
What term is used to describe data passed into/out of a program?
Variable
Loop
Constant
Parameter
Leo wants to create a subroutine that will roll a dice. Which syntax is correct?
def dice roll ():
def diceroll ()
def diceroll ():
def diceroll []:
What would the output be from the program shown here? (assuming that the user enters "John" and "Smith"
John
Smith
John Smith
Error
If a variable has "global scope" it can be
used anywhere in the program
only used outside of a function
only used inside of a function
used outside of the program
If a variable has "local scope" it is available for use outside of its function.
TRUE
FALSE
What will be the output of this program if the user enters "Han" and then "Solo"?
An error
Nothing
first surname
Han Solo
A function with 2 integer parameters could start with which definition?
funct addNumbers(num1, num2):
def addNumbers(num1, num2):
def 2Numbers(num1, num2):
FUNCTION addNumbers(x, y):
The values that a program provides to a function or subroutine in the calling stage.
loop
procedure
argument
conditional
parameter
The values that a program provides to a function or subroutine in the defining stage.
loop
procedure
argument
conditional
parameter
x, y are the (a) of the procedure "study", whilst 1, 2 are the (b) of the procedure "study"
Which of the following is an advantage of using local variables?
They allow the variable to be used throughout the whole program
They allow variable identifiers to be reused each time
They are easier to program than global variables
A wider range of data types can be used
What is a constant?
A named data store that contains a value that does not change during the execution of a program
A special symbol or word in a programming language that identifies an action to be performed
A named data store that contains a value that may change during the execution of a program
A positive or negative whole number that can be used with mathematical operators
What is a variable?
A special character or word in a programming language that identifies an action to be performed
A positive or negative whole number that can be used with mathematical operators
A named data store that contains a value that does not change during the execution of a program
A named data store that contains a value that may change during the execution of a program
What is an array?
A set of programming statements grouped together under a single name that can be called to perform a task in a program
A positive or negative whole number that can be used with mathematical operators
A data structure containing several elements of the same data type
A variable or constant that is several characters in length
What is the main reason for using a procedure in programming?
To save and retrieve data from a magical book
To perform calculations using wizardry
To declare, use, and manipulate different types of wands and spells
To group spells together under a single spellbook that can be called to perform a task in a program
What is the main purpose of a function in programming?
To group programming statements together under a single name that can be called to perform a task in a program
To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions
To perform calculations using arithmetic operators
To store data in a file and retrieve data from a file
What is the purpose of the MOD operator in programming?
To find the magical remainder of a division
To uncover the hidden quotient (whole number part) of a division
To perform a mystical rounding of a value to a given number of decimal places
To conjure a random number
What does the DIV operator do in programming?
To generate a random number
To round a value to a given number of decimal places
To return the quotient (whole number part) of a division
To return the remainder of a division
What is the purpose of the ROUND library routine in programming?
To generate a random number
To return the quotient (whole number part) of a division
To return the remainder of a division
To round a value to a given number of decimal places
What is the purpose of the RANDOM library routine in programming?
To return the remainder of a division
To generate a random number
To return the quotient (whole number part) of a division
To round a value to a given number of decimal places
What is the purpose of the AND operator in programming?
To perform logical AND operation on two boolean values
To combine two numbers together
To multiply two numbers
To divide two numbers
What is the purpose of the NOT operator in programming?
To reverse the value of a boolean variable
To perform addition of two numbers
To perform division of two numbers
To perform multiplication of two numbers
What is the purpose of the XOR operator in programming?
To perform exclusive OR operation on two boolean values
To combine two numbers together
To multiply two numbers
To divide two numbers
What is the main purpose of a subroutine in programming?
To group programming statements together under a single name that can be called to perform a task in a program
To declare, use, identify appropriate data types for, read and write arrays with one and two dimensions
To perform calculations using arithmetic operators
To store data in a file and retrieve data from a file
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.
a = true, b = true, c = false
x = not((a and b) and (b or c))
The final value of x is (a)
open("file.txt", w)
Create a new empty file and then add data
open("file.txt", a)
Append data to an existing file
open("file.txt", r)
Read data from an existing file
Label the following logic gates
An SQL command that counts the number of records (rows) in which the field (column) matches a specified condition; used with SELECT (a)
A classification of how data is stored and displayed, and of which operations that can be performed on the stored value
data type
data value
data
data packet
A persistent structured collection of data that allows people to extract information in a way that meets their needs
record
table
database
basedata
The values associated with each record in a database table
table
record
primary key
field
An SQL command that identifies the table to use
SELECT
FROM
WHERE
ORDER BY
An SQL command that sorts the results from a query by a given column either alphabetically or numerically
SUM
WHERE
COUNT
ORDER BY
A field in a database that uniquely identifies a record
public key
private key
primary key
secondary key
A collection of fields that describe one item
table
record
field
database
An SQL command that fetches specified fields (columns) from a table
SELECT
FROM
WHERE
ORDER BY
A database that contains only one table
object database
graph database
relational database
single-table database
A list of SQL commands that perform a given task, often stored in a file so it can be reused
original scripts
SQL Scripts
storyboard scripts
screenplay scripts
The standard query language for writing scripts to obtain useful information from a relational database
Hypertext Markup Language (HTML)
Data Manipulation Language (DML)
Data Definition Language (DDL)
Standard Query Language (SQL)
An SQL command that returns the sum of all the values in a field (column); used with SELECT
SELECT
SUM
FROM
WHERE
A collection of related records in a database
field
row
table
column
An SQL command to include only those records (rows) in a query that match a given condition
SELECT
FROM
WHERE
ORDER BY
2 < 3 AND (NOT (3>2))
False
True
If x = 3 and y = 5, choose all the statements that evaluate to True.
x < y
2*x == y
x + 2 == y
y*(x - 1) > x
A logic gate that outputs True only if both inputs are True is called...
eXOR
NOT
OR
AND
(1 + 2) >= 3 OR (-(1 + 3)> 5)
TRUE
FALSE
In which of the following logic gates the output is 1 if and only if at least one input is 1?
NOR
AND
NAND
OR
(NOT A) AND B = P
If A = 0 and B = 1, what does P equal?
1
0
