Save
...
Paper 2
2.2 Programming Fundamentals
2.2.3 Additional Programming Techniques
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
Arun Ananthasekaram
Visit profile
Cards (26)
What is an array in programming?
An array is a
static
data structure
that can hold a
fixed
number of data elements.
View source
What must each data element in an array be?
Each data element must be of the same
data type
.
View source
How are elements in an array identified?
The elements in an array are identified by an
index
number.
View source
What is the index of the first element in an array?
The first element in an array always has an index of
0
.
View source
What is the purpose of pseudo code in relation to arrays?
Pseudo code is used to manipulate arrays to
traverse
,
add
,
remove
, and
search
data.
View source
How can you traverse an array in Python?
You can use a for loop to display each data element in order.
View source
Can you insert new values into an array?
No, you cannot insert new values into an array since its size is fixed.
View source
What happens when you overwrite the fourth element in an array?
Overwriting the fourth element changes its
value
to the new value provided.
View source
How can you delete a value in an array?
You can overwrite it with a blank space to make it appear
deleted
.
View source
How do you search for a specific value in a large array?
A
for loop
is needed to search through each element for a specific value.
View source
What is a two-dimensional array?
A two-dimensional array is a data structure that can have multiple
rows
and
columns
.
View source
How is indexing done in a two-dimensional array?
Indexing in a two-dimensional array uses two values:
row
and
column
.
View source
How do you print a specific data element in a two-dimensional array?
You can use the
index number
to access and print the specific data element.
View source
How do you search for a specific value in a two-dimensional array?
You need two
for loops
: one for the row and another for the values of each row.
View source
What is a record in programming?
A record can store data of different
data types
.
View source
What is a field in a record?
A
field
is each
piece
of
information
in the
record.
View source
What is a key field in a record?
A key field is
unique
data that identifies each record.
View source
Why is a Student ID a good key field for a student record?
Because no two students can have the
same
Student ID.
View source
What does SQL stand for?
SQL stands for
Structured Query Language
.
View source
What is the purpose of SQL?
SQL is used to search for data in a
database
.
View source
What is the format of an SQL statement?
The format is:
SELECT
field1, field2, field3…
FROM
table
WHERE
criteria.
View source
Write an SQL statement to display the make and colour for cars that are grey or blue.
SELECT
Make
,
Colour
FROM Cars
WHERE
Colour = 'grey'
OR
Colour = 'blue'.
View source
Write an SQL statement to display all fields for cars that are 10 years old or less.
SELECT
*
FROM
Cars
WHERE
Age
<= 10.
View source
What are the differences between a 1D array, 2D array, and record?
1D Array: Holds a fixed number of elements of the same
data type
.
2D Array: Holds multiple rows and columns of the same data type.
Record: Can store different data types and consists of
fields
with a unique key field.
View source
What are the steps to manipulate arrays in Python?
Traverse: Use a for loop to display elements.
Insert: Change existing values (cannot add new).
Delete: Overwrite with a blank space.
Search: Use a for loop to find specific values.
View source
What is the role of wildcards in SQL?
Wildcards are symbols used to substitute characters.
The * symbol represents
ALL
fields
.
View source