Programming Fundamentals Flashcards

1
Q

What are the 3 constructs

A

sequence, selection and iteration

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

What is difference between local and global variables

A

Local: declared with a specific subroutine
Global: can be used at any point within the whole program

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

What are two advantages of using local variables

A

Saves memory when it is needed
Easier to debug local variables

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

What are two advantages of using global variables

A

Makes maintenance easier
Can be used

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

What is a constant

A

Data that does not change in value

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

List the 5 data types and give examples for each

A

Character: a single character
String: a sequence of characters
Integer: a whole number
Real: a decimal
Boolean: only has two possible values

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

What is casting

A

Converts the value of a variable from one data type to another

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