introduction to programming pmt flashcards

1
Q

what are the three main programming constructs used in procedural programming

A

-sequence
-selection
-iteration

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

how does assembly language differ from machine code

A

assembly language uses mnemonics rather than binary.one line in assembly language is equal to one line in machine code

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

what is the function of STA

A

storing the value in the accumulator at the given memory address

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

what is the function of BRP

A

branches to a given address if the value in the accumulator is positive
it is a conditional branch

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

describe how selection works

A

a certain block of code is run if a specific condition is met v, using IF, ELSE IF and ELSE statements

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

how do variables and constants differ

A

the value of a constant cannot be edited by the program during execution while the contents of a variable can be changed

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

when might constants be used

A

for values that do not need to be changed or to prevent a value from being accidentally changed

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

define what is meant by a function

A

a named block of code that performs a specific task and must always return a single value

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

what is the role of the MOD function

A

MOD is used to fin the reminder when the number is divided by another

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

what are relational operators used for

A

to make comparisons between two values and produce a result of either TRUE OR FALSE

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

What is the function of the == operator

A

used to check whether a value is identical to another

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

give three boolean operators

A

AND,OR,NOT

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

What programming structure is used when a certain section of code needs to be executed while a certain condition remains true

A

iteration=specifically in a WHILE LOOP

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