2.2.1 Programming Fundamentals Flashcards

1
Q

Addition operator

A

+

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

Subtraction operator

A

-

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

Multiplication operator

A

*

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

Division operator

A

/

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

Exponentiation operator

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

Quotient operator

A

DIV

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

Remainder operator

A

MOD

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

20 DIV 3

A

6

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

20 MOD 3

A

2

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

The assignment operator

A

=

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

What does the assignment operator do

A

Assigns values to constants or variables

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

Comparison operators

A

Compare the left hand side of the expression to the right and produces a Boolean value (true or false)

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

Is equal to

A

==

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

Is not equal to

A

!=

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

Is less than

A

<

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

Is greater than

A

>

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

Is less than or equal to

19
Q

Is greater than or equal to

20
Q

Constant

A

Assigned a value which cannot change

21
Q

Variable

A

Assigned a value which can change

22
Q

What happens if you attempt to change the value of a constant

A

An error is returned

23
Q

What data values are written in quotation marks

A

Character, string

24
Q

List the comparison operators

A

==
!=
<
>
<=
>=

25
Q

What are the three constructs which affect program flow

A

-Sequence
-Selection
-Iteration

26
Sequence
A set of instructions that follow on one from another
27
Selection
A decision within the program where the program decides to move based on the results of an event
28
Iteration
The repetition of statements within a computer program
29
Examples of selection statements
-if-else/elseif -switch
30
Structure of an if-else statement
if variable comparison data then Indent instructions… else indent instructions endif
31
How to ask the user for an input
variable = input(string)
32
Nested if statement
An if statement inside an if statement
33
Elseif
Checks multiple conditions
34
Structure of a switch statement
switch variable: indent case data: indent indent instructions indent case data: indent indent instructions… indent default: indent indent instructions endswitch
35
What does default mean in a switch statement
What will happen if no cases are correct
36
Benefits of switch statements over if-else statements
Neater way to test different values of a variable- easier to maintain
37
Drawbacks of switch statements over if-else statements
Switch can only check the value of one variable, if-else can check many
38
Examples of iteration statements
-For -Do until -While
39
Examples of count-controlled loops
-For
40
Examples of condition-controlled loops
-Do until -While
41
For loop
Will repeat the code inside of them a fixed number of times
42
Structure of a for loop