2.2 programming fundamentals part 2 Flashcards

1
Q

How do you make a loop?

A

For i =0 to 5:

The number are an example and will be printed out 5 times

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
What would the output be for the OR gate?
0 0
0 1
1 0
1 1
A
0
1
1
1
1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q
What would the output be for the AND gate?
0 0
0 1
1 0
1 1
A

0
0
0
1

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

What would the output be for the NOT gate?
0
1

A

It does the opposite
1
0

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

What are procedures?

A

Procedures carry out a set of instructions and stored under one name

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

What does procedures don’t require?

A

Parameter

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

What is a function?

A

Functions take a parameter and return a value (ALWAYS RETURN A VALUE)

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

What is a parameter?

A

Are variables used to pass values into the subprogram. They specify the name, datatype and value.

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

What are arguments?

A

Are the actual values that the parameters take when the sub program is called.

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

Why are functions and procedures useful?

A

They give the program more structure and readability and reduce the amount of code that is needed to write.

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

What is a Global variable?

A

Used in entire program

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

What is a local variable?

A

Can only be used in the structure they’re declared in

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