Paper II: Var's, Const's and Operators Flashcards

1
Q

Difference between variables and constants?

A

variables can change while the program is running but constants must not change.

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

What is an identifier?

A

The name to a variable or constant

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

Usefulness of short identifier?

A

Easier to spell correctly

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

Usefulness of long identifier?

A

More descriptive

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

What is assignment?

A

When the value of a variable/constant is assigned

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

How is assignment statement made for variables and constants?

A

With SET … TO or =

CONST

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

How can you name identifiers?

A

Camel case
Have first word lower case
Snake case

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

Program to recieve variable from user and display as output?

A

RECIEVE varOne FROM KEYBOARD

SEND varOne TO DISPLAY

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

Area of a rectangle program?

A

RECIEVE width FROM KEYBOARD
RECIEVE length FROM KEYBOARD

SET area to width * length
SEND area TO DISPLAY

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

What are all arithmetic operators?

A
\+ for addition
- for subtraction
* for multiplication
/ for division
MOD for Modulus
DIV for quotient
^ for exponential powers of e.g 3^2 = 9 which is 3²
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is order of operations?

A
BIDMAS
Brackes
Indices
Division
Multiplication
Addition
Subtraction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are all the relational operators?

A
= for equals to
<> for not equal to
< for less than
> for more than
<= for less than or equal to
>= for more than or equal to
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How are strings compared with relational operators?

A

Strings are compared alphabetically
e.g.
David is greater than Catherine
‘Db’ is greater than ‘Da’

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

What are the three main logical operators?

A

AND
OR
NOT

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

What does AND operator do?

A

Ensures that the overall statement is true if individual statements are all true.

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

What does OR operator do?

A

Ensures that the overall statement is true if one of the individual statements is true.

17
Q

What does the NOT operator do?

A

Reverses the logical state of other operators