2.2 Flashcards
1
Q
constant
A
a value that does not change while the program is desinged
2
Q
variable
A
a value stored in memory that can change while the program is running
3
Q
casting
A
converting a variable from one data type to another
4
Q
string manipulation
A
changing a string through collecting the length of the string (e.g. ‘.length’)
5
Q
what are the stages to write data to a file
A
- open the file for creating, overwriting or appendding a file
- write the data to a file
- close the file
6
Q
what are the stages to reading data in a file
A
- open the file for reading data
- assign a boolean variable to “false”
- read the data from the file to check if the data matched is what is beign looked for
- close the file
7
Q
how do you open a file name
A
e.g. “file = open(sample.txt)”
8
Q
what commands are used in SQL
A
- SELECT, which fields to be returned - can be used to indicate fields
- FROM, which table - databases can have more than one table, each with their own unique name
- WHERE, records meet a condition (* is used as a wild card)
9
Q
what is an array
A
- a static number of related data items that are stored together in the same memory space
- each data item has the same data type
- the particular item (element) is found using its index
10
Q
what is a sub-routine
A
- larger programs that are developed as a set of sub-programs
11
Q
why are sub-routines useful
A
- structuring codes into sub-programs makes the code easier to read and debug
- functions return values and create reusable program components
12
Q
what are procedures
A
- they create a modular structure to program making it easier to read
- each sub-program can easily be tested
- sub-programs can be saved into libraries and reused in other programs