Save
...
paper 2 cs
2.2 programming fundamentals
Additional Programming Techniques
Save
Share
Learn
Content
Leaderboard
Learn
Created by
anisah
Visit profile
Cards (46)
String
manipulation
The use of programming techniques to modify,
analyse
or extract information from a
string
View source
Case
conversion
The ability to change a string from one case to another, e.g.
lowercase
to
uppercase
View source
Length
(string manipulation)
Finding the
length
refers to the ability to count the number of characters in a
string
View source
Substring
The ability to extract a sequence of characters from a
larger string
using
slicing
View source
Concatenation
The ability to join
two
or more strings together to form a
single
string using the + operator
View source
ASCII
conversion
The ability to return an ASCII character from a
numerical
value and vice versa
View source
In
Python substrings are indexed from
0
View source
Python
code
print(name.upper()
)
print(len(password)
)
print(FName + SName)
View source
File
handling
The use of programming techniques to work with
information
stored in
text files
View source
Python
code
file = open("fruit.txt", "r")
file.close()
file.readline()
file.write("Oranges")
View source
"r" mode
Used for opening a file in
read-only
mode
View source
"w" mode
Used for opening a file in write mode, creating a new file if it doesn't exist, or
overwriting
an existing file
View source
"a" mode
Used for opening a file in
append
mode, writing to the end of an existing file
View source
It's important to make a
backup
of
text files
before working with them
View source
Database
An organised collection of data that allows easy
storage
,
retrieval
, and management of information
View source
Field
One piece of information
relating
to one person, item or object, represented as a
column
in a database
View source
Record
A collection of fields
relating
to one person, item or object, represented as a
row
in a database
View source
Array
(storing data)
Useful when working with
small
amounts of data, stored in main memory (
RAM
)
View source
Advantages
of using a database
Efficient
sorting
and
searching
of large amounts of data
Multiple user
access
Better
security
than text files
View source
Disadvantages
of using text files for data storage
It can be
difficult
to know where one record
begins
and ends
View source
Advantages
of using arrays for data storage
More efficient and
faster
to search than
text files
View source
When
are text files useful for data storage
Storing small amounts of data on
secondary storage
when the application is
closed
View source
SQL
A programming language used to interact with a Database Management System (
DBMS
)
View source
SELECT
(SQL)
The
SELECT
command in SQL is used to
retrieve
data (fields) from a database table
View source
FROM
(SQL)
The
FROM
command in SQL specifies the table(s) to
retrieve
data from
View source
WHERE
(SQL)
The WHERE command in SQL
filters
the data based on a
specified
condition
View source
The
'*' symbol is a
wildcard
in SQL
View source
SQL
commands
SELECT
* FROM Customers;
SELECT
name, age FROM Customers WHERE age > 30;
SELECT
country, population FROM world WHERE population < 100000;
View source
1D array
An
ordered
, static set of elements that can only store
one
data type
View source
2D array
An ordered, static set of elements that can only store one data type but adds another dimension. It can be visualised as a
table
with rows and
columns
View source
Python
code
temp
= [1, 2, 3, 4, 5]
print(
countries
[1])
students
[2] = "
Rebecca
"
scores = [[
1
, 2,
3
], [4, 5, 6], [7, 8, 9]]
View source
2D
arrays can only store
one
data type in the same array
View source
Zero
-indexing
Indexes of an array start from
0
, not
1
View source
Function
A type of
sub-program
that performs a specific task and returns a
value
View source
Procedure
A type of
sub-program
that performs a specific task but does not return a
value
View source
Parameter
A value that is passed into a
sub-program
(function or procedure)
View source
To
use a function/procedure it must be
'called'
View source
Global variable
A variable declared at the
outermost
level of a program and can be
accessed
from any part of the program
View source
Local variable
A
variable
declared within a specific scope, such as a function or
code block
, and can only be accessed within that scope
View source
Key
difference between function and procedure
A function returns a
value
, whereas a procedure does not return a
value
View source
See all 46 cards