2.2 New Flashcards

1
Q

variable

A

a named memory location that holds data that during the execution of a program, the data can change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what can variables store

A

different data types such as numbers, text or true/false values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

how to store data in a variable

A

process of assignment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

constant

A

fixed data that during the execution of a program cannot change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

what can a constant store

A

variety of different types of data

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

assignment

A

process of storing data in a variable or constant under a descriptive name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how to assign a value to a constant in OCR reference language

A

const pi = 3.141

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

operator

A

symbol used to instruct computer to perform a specific operation on one or more values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

examples of common operators

A

arithmetic
comparison
Boolean (and, or and not)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

input

A

a value that is read from an input device and then processed by a computer program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

output

A

value sent to an output device from a computer program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

programming construct

A

determines the order in which lines of code are executed

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

three programming constructs

A

sequence
selection
iteration

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

sequence

A

-refers to lines of code which are run one line at a time
-lines of code are run in they order that they are written from the first line of code to the last line of code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

selection

A

-when the flow of a program is changed, depending on a set of conditions
-the outcome of this condition determines which lines or blocks of code is run next

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

ways to write selection statements

A

if/then/else

case select or switch

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what is selection used for

A

validation, calculation and making sense of a user’s choices

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

difference between if and select case

A

-select case can mean less code but is only useful when comparing multiple values of the same variable
-if statements can be more flexible and are generally used more in languages such as Python

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

iteration

A

repeating a line or a block of code using a loop

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

two types of iteration

A

count controlled
condition controlled

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

count controlled

A

when the code is repeated a fixed number of times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

condition controlled

A

when the code is repeated until a condition is met

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

data type

A

-a classification of data into groups according to the kind of data they represent
-computers use different data types to represent different types of data in a program

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

what are the data types

A

-integer
-real
-character
-string
-boolean

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
integer
whole numbers
26
real
numbers with a fractional part
27
character
single character
28
string
sequence of characters
29
boolean
true or false values
30
importance of choosing the correct data type for a given situation
ensure accuracy and efficiency in the program
31
casting
converting one data type to another data type
32
string manipulation
use of programming techniques to modify, analyse or extract information from a string
33
examples of string manipulation
-case conversion -length -substrings -concatenation -ASCII conversion
34
case conversion
the ability to change as string from one case to another
35
length in string manipulation
the ability to count the number of characters in a string
36
substring in string manipulation
the ability to extract a sequence of characters from a larger string in order to be used by another function in the program
37
concatenation in string manipulation
the ability to join two or more strings together to form a single string
38
ASCII conversion in string manipulation
the ability to return an ASCII character from a numerical value and vice versa
39
file handling
use of programming techniques to work with information stored in text files
40
examples of file handling techniques
-opening text files -reading text files -writing text files -closing text files
41
database
-an organised collection of data -allows for easy storage, retrieval and management of information -data can be sorted and searched efficiently, making use of advanced structures -more secure than text files -uses fields
42
where are databased stored on
secondary storage, on remote servers so multiple users can access it at the same time
43
when is a database useful
when working with large amounts of data
44
what is a field
-one piece of information relating to one person, item or object -represented in a database of a column
45
what is a record
-collection of fields relating to one person, item of objects -represented in a database by a row
46
when are text files useful
when working with small amounts of data
47
where are text files stored
-secondary storage -are 'read' into a program when being used -used to store information when the application is stored
48
how is each entry on a text files separated
special identifier such as a comma
49
disadvantage of text files
difficult to know where a record begins and ends
50
when are arrays useful
when working with small amounts of data
51
where are arrays stored
-in main memory RAM -used to store information when the application is in use
52
advantage of arrays
more efficient and much faster to search than working with text files
53
what does SQL stand for
structures query language
54
what is SQL
a programming language used to interact with a database management system
55
SQL commands
-Select -From -Where
56
what does select mean in SQL
-retrieves data from a database table -means 'what field(s) do you want to retrieve'
57
what does from mean in SQL
-specifies the tables to retrieve data from
58
what does where mean in SQL
filters the data based on a specified condition
59
* symbol meaning in SQL
-known as a 'wildcard; -selected all fields in the table
60
example of SQL command
SELECT ID,name,age FROM Customers WHERE Age > 25
61
array
ordered static sets of elements in a fixed size memory location
62
how many data types can array store
1 data type
63
what is a 1D array known as
linear array
64
what do indexes start at in 1D arrays
0
65
2D arrays
extends the concept on a 1D array by adding another dimension
66
what are 2D arrays similar to
table with rows and columns
67
steps to navigate through a 2D array
go down the rows and then across the columns
68
what are functions and procdures
type of sub program, a sequence of instructions that perform a specific task or set of tasks
69
what can sub programs be used for
-to avoid duplicating code, can be reused throughout a program -improve readability and maintainability of code -perform calculations, to retrieve data, or to make decisions based on input
70
what are parameters
values that are passed into a sub program
71
what can parameters be and where are they located
-can be variables of values -located in brackets after the name of the sub program
72
difference between functions and parameters
functions return a value, parameters do not
73
global variable
-a variable declared at the outermost level of a program -they are declared outside any modules such as functions or procedures -have a global scope, meaning they can be accessed and modified from any part of the program
74
local variable
-variable declared within a specific scope, such as a function or a code block -local variables are accessible only within the block in which they are defined, and their lifetime is limited to that particular block -once the execution of the block ends. the local variable is destroyed, and its memory is released
75
random number generation
a programming concept that involves a computer generating a random number to be used within a program to add an element of unpredictability
76
examples where RNG should be used
-simulating dice roll -selecting random question -national lottery -cryptography