Lecture 1 Flashcards

1
Q

Can arrays store more than one data type?

A

No! Only one type is allowed

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

How would you take in a decimal int with a maximum of 5 spaces?

A

%5d

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

Do C arrays grow or shrink dynamically?

A

No, they can’t on their own

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

True or False: Old C only allowed for you to use a constant as the number of entries

A

True

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

What are the three components of a loop?

A

Initialization information
Loop increment operation
Termination condition

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

Can any of the items of the for statement be excluded?

A

C assumes no action for that step if the item is missing

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

What is the format of a while loop?

A
initialization
while(terminal){
statement
increment info
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the minimum number of times to execute a while loop?

A

0 or more

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

What is the format of a do while loop?

A
initialization
do{
statement
increment
}while (termination condition);
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is the minimum number of times to execute a do while loop?

A

1 or more

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

Name an example of white box testing?

A

Add multiple “if” statements, try each case and ensure appropriate output

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

Name an example of white box testing on a linear search in an array?

A

Search for first, middle and last entry

Search for an entry not in the array

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