2.2 New Flashcards

You may prefer our related Brainscape-certified 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
Q

integer

A

whole numbers

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

real

A

numbers with a fractional part

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

character

A

single character

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

string

A

sequence of characters

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

boolean

A

true or false values

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

importance of choosing the correct data type for a given situation

A

ensure accuracy and efficiency in the program

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

casting

A

converting one data type to another data type

32
Q

string manipulation

A

use of programming techniques to modify, analyse or extract information from a string

33
Q

examples of string manipulation

A

-case conversion
-length
-substrings
-concatenation
-ASCII conversion

34
Q

case conversion

A

the ability to change as string from one case to another

35
Q

length in string manipulation

A

the ability to count the number of characters in a string

36
Q

substring in string manipulation

A

the ability to extract a sequence of characters from a larger string in order to be used by another function in the program

37
Q

concatenation in string manipulation

A

the ability to join two or more strings together to form a single string

38
Q

ASCII conversion in string manipulation

A

the ability to return an ASCII character from a numerical value and vice versa

39
Q

file handling

A

use of programming techniques to work with information stored in text files

40
Q

examples of file handling techniques

A

-opening text files
-reading text files
-writing text files
-closing text files

41
Q

database

A

-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
Q

where are databased stored on

A

secondary storage, on remote servers so multiple users can access it at the same time

43
Q

when is a database useful

A

when working with large amounts of data

44
Q

what is a field

A

-one piece of information relating to one person, item or object
-represented in a database of a column

45
Q

what is a record

A

-collection of fields relating to one person, item of objects
-represented in a database by a row

46
Q

when are text files useful

A

when working with small amounts of data

47
Q

where are text files stored

A

-secondary storage
-are ‘read’ into a program when being used
-used to store information when the application is stored

48
Q

how is each entry on a text files separated

A

special identifier such as a comma

49
Q

disadvantage of text files

A

difficult to know where a record begins and ends

50
Q

when are arrays useful

A

when working with small amounts of data

51
Q

where are arrays stored

A

-in main memory RAM
-used to store information when the application is in use

52
Q

advantage of arrays

A

more efficient and much faster to search than working with text files

53
Q

what does SQL stand for

A

structures query language

54
Q

what is SQL

A

a programming language used to interact with a database management system

55
Q

SQL commands

A

-Select
-From
-Where

56
Q

what does select mean in SQL

A

-retrieves data from a database table
-means ‘what field(s) do you want to retrieve’

57
Q

what does from mean in SQL

A

-specifies the tables to retrieve data from

58
Q

what does where mean in SQL

A

filters the data based on a specified condition

59
Q
  • symbol meaning in SQL
A

-known as a ‘wildcard;
-selected all fields in the table

60
Q

example of SQL command

A

SELECT ID,name,age
FROM Customers
WHERE Age > 25

61
Q

array

A

ordered static sets of elements in a fixed size memory location

62
Q

how many data types can array store

A

1 data type

63
Q

what is a 1D array known as

A

linear array

64
Q

what do indexes start at in 1D arrays

A

0

65
Q

2D arrays

A

extends the concept on a 1D array by adding another dimension

66
Q

what are 2D arrays similar to

A

table with rows and columns

67
Q

steps to navigate through a 2D array

A

go down the rows and then across the columns

68
Q

what are functions and procdures

A

type of sub program, a sequence of instructions that perform a specific task or set of tasks

69
Q

what can sub programs be used for

A

-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
Q

what are parameters

A

values that are passed into a sub program

71
Q

what can parameters be and where are they located

A

-can be variables of values
-located in brackets after the name of the sub program

72
Q

difference between functions and parameters

A

functions return a value, parameters do not

73
Q

global variable

A

-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
Q

local variable

A

-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
Q

random number generation

A

a programming concept that involves a computer generating a random number to be used within a program to add an element of unpredictability

76
Q

examples where RNG should be used

A

-simulating dice roll
-selecting random question
-national lottery
-cryptography