In: Computer Science
The statement: "int ar[7] = {0};" sets all of the array elements of ar to 0 (zero)
True
False
-------------------------------------------
#define SIZE 3 - declares a constant value named SIZE, equal to 3, that is available throughout your program and is immutable.
True
False
----------------------------------------
Select all of the following that apply to an array:
1. |
Contiguous storage is storage without any gaps. |
|
2. |
Arrays make programming complex problems more difficult. |
|
3. |
An arrays elements are stored contiguously in memory. |
|
4. |
We can declare an array without defining a size or adding any elements at the time of declaration. |
|
5. |
An array is a data structure consisting of an ordered set of elements of common type |
We define constants so that when a value that is used frequently throughout a program must be changed, we only have to change the value in one place.
True
False
====================================
Select all of the following answers that are true:
1. |
In order to store 30 characters in a C string we must allocate enough space for 31 elements. |
|
2. |
The format specifier to print a C string using printf is %c. |
|
3. |
The index of the null terminator in a C string represents the number of meaningful characters in the string. |
|
4. |
The null terminator has the value 0 (zero) on some host platforms, and the value -1 on others. |
Select all of the following statements which are true:
1. |
The elements of parallel arrays with the same index make up the fields of a single record of information. |
|
2. |
In parallel arrays it is not always the case that the key and the value are stored at the same index. |
|
3. |
In a simple set of two parallel arrays, one array holds the key and the other array holds the value. |
|
4. |
Parallel arrays are an inconvenient way to store tabular information. |
---------------------------
The index of the first element of an array is usually 0 (zero), but can be set to a different value.
True
False
The statement: "int ar[7] = {0};" sets all of the array elements of are to 0 (zero)
True
False
Answer: True
////////////////////////////////////////////////////////////////////////////////
#define SIZE 3 - declares a constant value named SIZE, equal to 3, that is available throughout your program and is immutable.
True
False
Answer: True
////////////////////////////////////////////////////////////////////////////////
Select all of the following that apply to an array:
1. |
Contiguous storage is storage without any gaps. |
|
2. |
Arrays make programming complex problems more difficult. |
|
3. |
An arrays elements are stored contiguously in memory. |
|
4. |
We can declare an array without defining a size or adding any elements at the time of declaration. |
|
5. |
An array is a data structure consisting of an ordered set of elements of common type |
Answer:
1. Contiguous storage is storage without any gaps. False
2. Arrays make programming complex problems more difficult. False
3. An arrays elements are stored contiguously in memory. True
4. We can declare an array without defining a size or adding any elements at the time of declaration. True
5. An array is a data structure consisting of an ordered set of elements of common type True
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
We define constants so that when a value that is used frequently throughout a program must be changed, we only have to change the value in one place.
True
False
Answer:
True
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Select all of the following answers that are true:
1. |
In order to store 30 characters in a C string we must allocate enough space for 31 elements. |
|
2. |
The format specifier to print a C string using printf is %c. |
|
3. |
The index of the null terminator in a C string represents the number of meaningful characters in the string. |
|
4. |
The null terminator has the value 0 (zero) on some host platforms, and the value -1 on others. |
Answer:
1. In order to store 30 characters in a C string we must allocate enough space for 31 elements. True
2. The format specifier to print a C string using printf is %c. True
3. The index of the null terminator in a C string represents the number of meaningful characters in the string True
4. The null terminator has the value 0 (zero) on some host platforms, and the value -1 on others. False
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Select all of the following statements which are true:
1. |
The elements of parallel arrays with the same index make up the fields of a single record of information. |
|
2. |
In parallel arrays it is not always the case that the key and the value are stored at the same index. |
|
3. |
In a simple set of two parallel arrays, one array holds the key and the other array holds the value. |
|
4. |
Parallel arrays are an inconvenient way to store tabular information. |
Answer:
1. The elements of parallel arrays with the same index make up the fields of a single record of information True
2. In parallel arrays it is not always the case that the key and the value are stored at the same index. False
3. n a simple set of two parallel arrays, one array holds the key and the other array holds the value. True
4. Parallel arrays are an inconvenient way to store tabular information. False
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
The index of the first element of an array is usually 0 (zero), but can be set to a different value.
True
False
Answer: True