2.2 Programming Fundamentals Flashcards

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

A

Modulo

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
Q

Function

A

A subroutine that returns a value

26
Q

Procedure

A

A subroutine that doesn’t return a value

27
Q

String.length len(string)

A

Returns the length of a string

28
Q

String.upper string.upper()

A

Returns the string in uppercase

29
Q

String.lower string.lower()

A

Returns the string in lowercase

30
Q

String.substring(startingPosition, numberOfCharacters) string[x:i]

A

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
Q

String.left(i)

A

Returns the left most characters from a string where the parameter indicates how many to return

32
Q

String.right(i)

A

Returns the right most characters from a string where the parameter indicates how many to return

33
Q

+

A

Joins separate strings values together

34
Q

ASC(…) ord(…)

A

Returns the ASCII value of a character

35
Q

CHR(…) chr(…)

A

Returns a character from its ASCII number

36
Q

Record

A

A data structure consisting of fields which can all be of different types of data

37
Q

Field

A

A single item of data in a record

38
Q

“r”

A

Read - Default value, opens a file for reading, returns an error if the file does not exist

39
Q

“a”

A

Opens a file for appending, creates the file if it doesn’t exist, appends to the end of the file

40
Q

“w”

A

Opens a file for writing, creates a file if it doesn’t exist, will overwrite any existing content

41
Q

“x”

A

Creates the specified file, returns an error if the file already exists

42
Q

f.readline()

A

Reads the next line of a file

43
Q

f.close()

A

Closes a file when you are done with it

44
Q

f.write(“…”)

A

Writes to the file

45
Q

If os.path.exist(“demofile.txt”)

A

Checks if file exists

46
Q

os.remove(“demofile.txt”)

A

Deletes a file

47
Q

SELECT …

A

(List the fields to be displayed)

48
Q

FROM …

A

(Specify table name)

49
Q

WHERE

A

(List the search criteria)

50
Q

=

A

Checks the value of a field

51
Q

AND

A

Both conditions must be true

52
Q

OR

A

Either condition must be true

53
Q

NOT

A

Condition must be false

54
Q

*

A

Wildcard - meaning “all columns” or remainder of a string