Software Development Flashcards

1
Q

How do you find the minimum number in a list?

A

set min to array(0)

for index = 1 to _ 
if array(index) < min then
min = array(index)
end if 
end for
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How do you find the maximum number in a list?

A

set max to array(0)

for index = 1 to _ 
if array(index) > max then
max = array(index)
end if 
end for
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Count Occurrences

A

receive target from keyboard
numfound = 0

for index = 1 to _
if array(index) = target then
numfound = numfound + 1
end if 
end for
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Linear Search (Fixed Loop)

A

receive target from keyboard
found = false
pos = 0

for index = 1 to _
if array(index) = target then
found = true
pos = index
end if 
end for
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Where can an actual parameter be found?

A

Procedure Calls

example: CALL GetDimensions(UserLen, UserBre)

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

Where can a formal parameter be found?

A

Procedure definitions

example: PROCEDURE GetDimensions(length, breadth)

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

What is meant by ‘the scope of a variable’?

A

The extent of code in which a variable can be accessed and modified.

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

Where can a global variable be accessed?

A

From any part of the program.

They do not have to be passed into procedures as parameters because the procedure can access it without doing so.

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

What is a disadvantage of a global variable?

A

It reduces the modularity of a program and should be avoided wherever possible.

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

Where can a local variable be accessed?

A

Only within a procedure or function. They are declared within a sub-program.

They are not passed in or out and can only be used in the sub-program they were declared in.

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

What is a disadvantage of using a local variable?

A

They cannot be accessed from out with their own sub-program, which limits their scope.

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

What is a dry run?

A

A dry run is the process of a programmer manually working through their code to trace the value of variables. There is no software involved in this process.

The programmer would sit down with a pen and paper and manually follow the value of a variable to check that it was used and updated as expected.

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

What are trace tables used for?

A

to allow programmers to trace the value of variables as each line of code is executed.

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

What is a breakpoint

A

A breakpoint is a point in the program where the code will stop executing.

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

What is a watchpoint?

A

When the code will stop at each individual value in order to check if it is the expected outcome.

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

What is the difference of a function and a procedure?

A

Function - Returns a single value

Procedure - Returns multiple values

17
Q

Why do programmers refer to data flow?

A

The data flow will become a he parameters that need to be passed in the program.

18
Q

Why does using procedures and functions improve efficient of code?

A

Less lines of code as it removes repetition of code

- you can call the same procedure more than once with different parameters.