CS 159 Lab 11 True or False

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/51

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

52 Terms

1
New cards

In a fixed-length array the size of the array is known when the program is written.

T

2
New cards

Arrays must be declared and defined before they can be used.

T

3
New cards

Array declarations will determine the type, name, and size of the array

T

4
New cards

For a value to be potentially used as an index it must be an integral value or an expression that evaluates to such.

T

5
New cards

The name of an array is a reference to the address of where it begins inside the memory of the computer.

T

6
New cards

The index value represents an offset from the beginning of the array to the element being referenced.

T

7
New cards

Declaration and definition of an array will include a default initialization of all elements.

F

8
New cards

Declaration and definition of an array will not include a default initialization of all elements.

T

9
New cards

If the number of values provided for initialization of an array is fewer than the size of the array then the

remaining elements have no known value.

F

10
New cards

If the number of values provided for initialization of an array is fewer than the size of the array then the

remaining elements are zeros.

T

11
New cards

The address operator is not necessary in a scanf to accept input for an individual array element when using the

indexing technique.

F

12
New cards

The address operator is necessary in a scanf to accept input for an individual array element when using the

indexing technique.

T

13
New cards

When accessing an array element the C language does not check whether the index is within the boundary of an

array.

T

14
New cards

Arrays can be passed in two ways; by individual elements or the whole array.

T

15
New cards

Elements of an array, themselves individual values of a given data type, are passed by value from calling to

called function.

T

16
New cards

The called function cannot tell whether the value it receives comes from an array, an individual variable, or an

expression that evaluates to the expected type.

T

17
New cards

Individual elements of an array can be passed by address through the use of the address operator

T

18
New cards

The reason that the C language does not pass whole arrays by value is the extra stress it would put on the

memory of the computer to make a copy of an array.

T

19
New cards

The name of an array is a primary expression whose value is the address of the first element in the array.

T

20
New cards

Indexed references to individual elements of an array are simply calculated addresses where the index value is

added to the address represented by the name of the array.

T

21
New cards

Passing the array name to a function allows changes in the called function to be available back in the calling

function after it terminates.

T

22
New cards

When passing a whole array to the function the total size of the array is necessary in the function call.

F

23
New cards

When passing a whole array to the function the total size of the array is not necessary in the function call.

T

24
New cards

When passing a whole array to the function the total size of the array is necessary in the definition of the called

function.

F

25
New cards

When passing a whole array to the function the total size of the array is not necessary in the definition of the called

function.

T

26
New cards

It is only the starting point of the array in memory that is represented by the name of an array and not the ending

point.

T

27
New cards

It is a course standard to make use of a symbolic/defined constant to represent the size of a statically declared

array.

T

28
New cards

The conversion code to use for input or output of an array element depends on the data type of the array.

T

29
New cards

Variables and loops are commonly used together to generate index values to access the elements of an array.

T

30
New cards

Arrays in the C programming language use a one-based index.

F

31
New cards

Arrays in the C programming language use a multi - based index.

T

32
New cards

To pass the whole array to a function you need to use the name of the array followed by empty square braces []

in the function call statement.

F

33
New cards

To pass the whole array to a function you need to use the empty square braces []

in the function call statement.

T

34
New cards

All elements of one array can be assigned to another through the use of the assignment operator and the name of

each array (example: x = y).

F

35
New cards

All elements of one array cannot be assigned to another through the use of the assignment operator and the name of

each array (example: x = y).

T

36
New cards

While the default technique of passing array elements is by value it is possible to pass elements by address using

the & operator (and the * operator in the function being called).

T

37
New cards

If more than one element of an array is passed to a function in a single function call then those elements are

passed by address.

F

38
New cards

If more than one element of an array is passed to a function in a single function call then those elements are

passed by value

T

39
New cards

Using the name of an array in the data list of a single printf function will result in the output of all elements of

the array.

F

40
New cards

To pass the whole array to a function you need to use the empty square braces []

in the function call statement.

F

41
New cards

All arrays sent to a given user-defined function must be of the same defined size.

F

42
New cards

All arrays sent to a given user-defined function may not be of the same defined size.

T

43
New cards

What is the value found at index 4 in the array after the code segment below has been executed?

int x[5];

int i;

for(i = 0; i < 4; i++)

{

x[i] = 2 * i - 1;

}

There would be only junk values because the array is not initialized.

44
New cards

All elements of one array cannot be assigned to another through the use of the assignment operator and the name of each array (example: x = y).

T

45
New cards

Declaration and definition of an array will include a default initialization of all elements.

F

46
New cards

The address operator is not necessary in a scanf to accept input for an individual array element when using the indexing technique.

F

47
New cards

The name of an array is a primary expression whose value is the address of the first and last element in the array.

F

48
New cards

If the number of values provided for initialization of an array is fewer than the size of the array then the remaining elements are assigned a value of zero.

T

49
New cards

What are the values in the array after the code below has been executed?

int x[5] = {2, 5, 7, 3, 1};

int i;

for(i = 1; i <= 4; i++)

{

x[i - 1] += x[i];

}

7 12 10 4 1

50
New cards

When accessing an array element the C language does not check whether the index is within the boundary of an array.

T

51
New cards

Individual elements of an array cannot be passed by address.

F

52
New cards

When passing a whole array to the function the total size of the array is necessary in the definition of the called function.

F