Programming Flashcards

1
Q

Syntax

A

Set of rules defining how program statements must be written,
in order for translators to understand them

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

Variable

A

Identifier associated with a particular memory location,
used to store data

Its value may change as the program is run and new values are assigned to it

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

Integer

A

Data type for whole numbers

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

System flow chart

A

Diagram using commonly defined symbols to express an algorithm

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

Pseudocode

A

Way of writing algorithm that is close to actual programming language,
using coding style constructs

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

Sequence

A

Where instructions are executed one after another in series

Program where a computer starts at beginning of program,
executes each statement once until it gets to the end and stops

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

Identifier

A

Unique name for something (variable, constant, program, procedure) within the program

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

Data type

A

Formal description of type of data being stored in a variable
Defines amount of memory required and type of operation that can be performed on that variable

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

Python maths operator +

A

Addition

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

Python maths operator -

A

Subtraction

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

Python maths operator *

A

Multiplication

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

Python maths operator /

A

Division

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

Python maths operator %

A

Remainder after division

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

Python maths operator **

A

Exponent
(power of)

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

Python maths operator //

A

Whole number division
(Decimal number is rounded down to nearest integer)

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

Where is data stored while program is running

A

Main memory
RAM

17
Q

Casting

A

Assigning a value or a new value to a variable

18
Q

Rules of variable naming

A

NO spaces e.g. my name -> myName or my_name
Not use any reserved keywords (see below)
Choose consistent naming style and stick to it
Must begin with a letter (a–z, A–Z) or underscore (_)
Other characters can be letters, numbers or _
Variable names are case-sensitive (this means you must use the same CAPITALS or lower case wherever you use the variable name)
Use a name that makes sense (in the context of the program) e.g. student_Name NOT sn

19
Q

Integer data type

A

Whole number values, positive or negative with no decimal place or fractional part

Typical size: 2 - 4 bytes

20
Q

Real/float data type

A

Numbers with a decimal or fractional part

Typical size: 4 - 8 bytes

21
Q

Character data type

A

Single alphanumeric character

22
Q

String data type

A

Any string of alphanumeric characters
Typical size: 5 bytes

23
Q

Boolean data type

A

One or two values: True or False

24
Q

Why variables are used

A

Used to store data and label data

25
Q

Assignment statement

A

Means reassigning value of a variable

26
Q

Advantages of using named constants rather than variables

A

Named constant is a variable, but you cannot reassign its value

27
Q

Advantages of using a named constant rather than the actual value

A

This would keep program code constant,
and without any additional variable reassigning, make it easier to debug

28
Q

Python indexing

A

Arrays:
[“place 0”, “place 1”, “place 2”, “place 3”]