Lecture 1 Flashcards
Can arrays store more than one data type?
No! Only one type is allowed
How would you take in a decimal int with a maximum of 5 spaces?
%5d
Do C arrays grow or shrink dynamically?
No, they can’t on their own
True or False: Old C only allowed for you to use a constant as the number of entries
True
What are the three components of a loop?
Initialization information
Loop increment operation
Termination condition
Can any of the items of the for statement be excluded?
C assumes no action for that step if the item is missing
What is the format of a while loop?
initialization while(terminal){ statement increment info }
What is the minimum number of times to execute a while loop?
0 or more
What is the format of a do while loop?
initialization do{ statement increment }while (termination condition);
What is the minimum number of times to execute a do while loop?
1 or more
Name an example of white box testing?
Add multiple “if” statements, try each case and ensure appropriate output
Name an example of white box testing on a linear search in an array?
Search for first, middle and last entry
Search for an entry not in the array