Programming Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is the difference between a character and a string?

A

A character is one character, string can be multiple characters long

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

What is declaration?

A

Creation of a variable

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

What concept uses an IF statement?

A

selection

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

What is meant by a nested IF statement?

A

If statements inside if statements

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

Why should you use meaningful identifier names?

A

easier to read
easier to debug
less need for comments

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

What is self-documenting code?

A

code which is written in such a way as to be easy
to read and understand by other programmers
without the need for extra documentation

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

What 4 components make up a variable?

A

Memory address, identifier, data type, value

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

What is an identifier for a variable?

A

How the variable is referred to in the code

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

What is meant by concatenation?

A

Joining multiple strings together

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

Why should you use subroutines

A
less duplication of code 
only need to change or update code once 
easier to read 
easier to debug 
subroutines can be re-used in other programs  workload can be split
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the name of a subroutine that doesn’t return a value?

A

Procedure

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

What is the name of a subroutine that returns a value?

A

Function

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

What does the scope of a variable mean?

A

Visibility of a variable

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

What are the advantages of local variables?

A
uses less memory 
less likely to make assignment errors 
easier to debug 
identifier names can be re-used in other subroutines
subroutines can be re-used elsewhere
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the disadvantages of global variables?

A

uses more memory
more likely to make assignment errors
harder to debug
harder to come up with meaningful and unique identifier names
subroutines cannot be used in other programs

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

What three things are stored in the stack frame?

A

return address
parameters
local variables

17
Q

Where are stack frames stored?

A

Call stack

18
Q

What is meant by a recursive function?

A

A function that calls itself

19
Q

What is meant by the base case of a recursive algorithm?

A

The case in which a recursive function does not call

itself

20
Q

What is meant by the general case of a recursive algorithm?

A

A case in which a recursive function calls itself