2.2 Programming Fundamentals Flashcards

1
Q

Variable

A

A changeable named container

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

Constants

A

An available value that doesn’t change during the execution of the program

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

Operators

A

A character(s) that determine what action is to be performed

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

Inputs

A

Data supplied to the computer program by a user

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

Outputs

A

A form of interaction between the computer and the user

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

Assignments

A

Giving a variable a value

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

Sequence

A

A set of program instructions written and executed one after another

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

Selection

A

Certain lines of code will only execute if a condition is met

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

Iteration

A
  • Condition-controlled, when a set of instructions is repeated based on whether a condition evaluates as true or false e.g. while loops
  • Count-controlled, when a set of instructions is repeated a specific number of times e.g. for loops
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Casting

A

Converting data types

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

==

A

Equal to

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

!=

A

Not equal to

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

<

A

Less than

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

<=

A

Less than or equal to

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

>

A

Greater than

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

> =

A

Greater than or equal to

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

+

A

Addition

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

-

A

Subtraction

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

/

A

Division

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

*

A

Multiplication

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

DIV or //

A

Quotient

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

MOD or %

23
Q

^ or **

A

Exponentiation (to the power of)

24
Q

Subroutine

A

A named block of self-contained code which performs a specific task

25
Function
A subroutine that returns a value
26
Procedure
A subroutine that doesn’t return a value
27
String.length len(string)
Returns the length of a string
28
String.upper string.upper()
Returns the string in uppercase
29
String.lower string.lower()
Returns the string in lowercase
30
String.substring(startingPosition, numberOfCharacters) string[x:i]
Returns parts of a string, starting at the character of the first parameter and counting up by the number in the second parameter (pseudocode) or ending on the character of the last parameter non-inclusive (python)
31
String.left(i)
Returns the left most characters from a string where the parameter indicates how many to return
32
String.right(i)
Returns the right most characters from a string where the parameter indicates how many to return
33
+
Joins separate strings values together
34
ASC(…) ord(…)
Returns the ASCII value of a character
35
CHR(…) chr(…)
Returns a character from its ASCII number
36
Record
A data structure consisting of fields which can all be of different types of data
37
Field
A single item of data in a record
38
“r”
Read - Default value, opens a file for reading, returns an error if the file does not exist
39
“a”
Opens a file for appending, creates the file if it doesn’t exist, appends to the end of the file
40
“w”
Opens a file for writing, creates a file if it doesn’t exist, will overwrite any existing content
41
“x”
Creates the specified file, returns an error if the file already exists
42
f.readline()
Reads the next line of a file
43
f.close()
Closes a file when you are done with it
44
f.write(“…”)
Writes to the file
45
If os.path.exist(“demofile.txt”)
Checks if file exists
46
os.remove(“demofile.txt”)
Deletes a file
47
SELECT …
(List the fields to be displayed)
48
FROM …
(Specify table name)
49
WHERE
(List the search criteria)
50
=
Checks the value of a field
51
AND
Both conditions must be true
52
OR
Either condition must be true
53
NOT
Condition must be false
54
*
Wildcard - meaning “all columns” or remainder of a string