Chapter 5 & 6 Flashcards

Arrays and User-Defined Functions (15 cards)

1
Q

What is an array?

A

It is a special variable having one name, but storing a list of data items, with each item being directly accessible.

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

What is a vector?

A

Used by some languages, which is similar to array

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

What is an element?

A

It is the name of each item in an array.

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

What is an “index”?

A

This is the location number of each element within an array.

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

What is the meaning of swapping two variables?

A

This means y’s values assigned to x’ values, and vice versa.

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

What is a function?

A

It is a named list of statements

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

What is a function definition?

A

It contains details of the function, that can be stored for later use, and won’t be ran unless you call it. -Parameters can be added here.//
It consists of the new function’s name and a block of statements. The function’s name can be any valid identifier.

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

What is a function call?

A

It is an invocation of a function’s name, causing the function’s statements to execute.

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

What is a local variable?

A

It is a variable declared in a function, which is then accessible only within that function.

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

Define “parameter”.

A

It is a function input specified in a function definition. This is like a variable declaration.
Ex: A pizza area function might have diameter as an input.

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

Define “argument”.

A

It is a value provided to a function’s parameter during a function call. Ex: PrintPizzaArea(12.0)

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

What is a scalar variable?

A

It stores only one item

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

Define modular development.

A

It is the process of dividing a program into separate modules that can be developed and tested separately and then integrated into a single program.

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

Define incremental development.

A

It is a process in which a programmer writes and tests a few statements, then writes and tests a small amount more, and so on.

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

Define function stub.

A

It is a function definition whose statements have not yet been written.

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