Deck 8: Arrays

ملء الشاشة (f)
exit full mode
سؤال
To add up all the values in a two- dimensional array it would be best to use

A)one for loop
B)one sentinel controlled loop
C)two separate for loops
D)a nested for loop
E)no loop
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
If the scores array is defined like this: <strong>If the <sup>scores</sup><sup> </sup>array is defined like this:  </strong> A)7 B)8 C)4 D)9 E)the first four scores <div style=padding-top: 35px>

A)7
B)8
C)4
D)9
E)the first four scores
سؤال
When an array is passed to a function, it is actually _ the array that is/are passed.

A)the data type and size of
B)the value stored in the first element of
C)the starting memory address of
D)a copy of all the values in
E)none of the above
سؤال
To step through a one- dimensional array, accessing the elements one by one, it would be most appropriate to use loop.

A)a nested loop
B)an infinite
C)no
D)a sentinel controlled loop
E)a for loop
سؤال
If you leave out the size declarator in an array declaration

A)the array will contain no elements.
B)the value of each array element is set to a default value of 0.
C)the array size defaults to 100 elements.
D)the array cannot be created.
E)you must furnish an initialization list.
سؤال
An array can store a group of values, but the values must be

A)all the same data type.
B)numeric, not characters or strings.
C)declared at the time the array is created.
D)constants.
E)none of the above.
سؤال
By using the same you can build relationships between data stored in two or more arrays.

A)arguments
B)subscript
C)array name
D)data type
E)data
سؤال
The statement typedef int oneDArray[20];
Does which of the following?

A)creates an array of 20 integers
B)makes oneDArray an alias for a data type that holds 20 integers
C)creates a one- dimensional integer array with all elements initialized to 20
D)makes oneDArray a copy of another 20- integer array
E)none of the above
سؤال
You can assign the contents of one array to another by using

A)both array names.
B)the equality operator.
C)the assignment operator.
D)A and C together.
E)none of the above.
سؤال
When a relationship is established between two or more arrays by using the same subscript to relate entries between the arrays, the arrays are called arrays.

A)indexed
B)paired
C)parallel
D)linked
E)brother
سؤال
When you pass an array as an argument to a function, the function can modify the contents of the array.
سؤال
A two- dimensional array can be viewed as

A)a table with rows and columns.
B)two columns of indexes.
C)two rows of values.
D)any of the above.
E)none of the above.
سؤال
When an array is passed to a function, it is actually the array that is passed.

A)the data type and name of
B)a copy of all the values in
C)the starting memory address of
D)the value stored in the first element of
E)the data type and size of
سؤال
C++ allows array elements to be class objects provided they are all instances of the same class.
سؤال
To access an array element, use the array name and the element's

A)value.
B)name.
C)data type.
D)size declarator.
E)subscript.
سؤال
Subscript numbering in C++

A)can begin with a programmer- defined value.
B)automatically begins with zero.
C)can be set at run time.
D)automatically begins with one.
E)varies from program to program.
سؤال
The statement <strong>The statement   is an example of</strong> A)an illegal array declaration. B)an illegal array initialization. C)data encapsulation. D)default arguments. E)implicit array sizing. <div style=padding-top: 35px> is an example of

A)an illegal array declaration.
B)an illegal array initialization.
C)data encapsulation.
D)default arguments.
E)implicit array sizing.
سؤال
Unlike regular variables, arrays can hold multiple

A)data types.
B)values.
C)variables.
D)named constants.
E)operators.
سؤال
A one- dimensional array can be initialized at the time it is defined, but a two- dimensional array cannot be.
سؤال
Assuming employee is an array of objects with a public member function named
setHourlyWage, the following statement correctly calls this method for employee[2].
Assuming <sup>employee</sup><sup> </sup>is an array of objects with a public member function named <sup>setHourlyWage</sup>, the following statement correctly calls this method for <sup>employee[2]</sup>.  <div style=padding-top: 35px>
سؤال
The following statement adds a new element to a the department vector at index 25.
The following statement adds a new element to a the <sup>department</sup><sup> </sup>vector at index 25.  <div style=padding-top: 35px>
سؤال
The following statement is a valid C++ array definition.
The following statement is a valid C++ array definition.  <div style=padding-top: 35px>
سؤال
The amount of memory used by an array depends upon the array's data type and how many elements in the array currently have data stored in them.
سؤال
To assign the entire contents of one array to another, you can use the assignment operator.
سؤال
Each individual element of an array can be accessed by the array name and an element number, called a subscript.
سؤال
When you create a vector it is unnecessary to specify how many elements it will hold because it will expand in size as you add new values to it.
سؤال
The following statement initializes all five elements of the number array to 1.
The following statement initializes all five elements of the <sup>number</sup><sup> </sup>array to 1.  <div style=padding-top: 35px>
سؤال
The amount of memory used by an array depends solely on the number of elements the array can hold.
سؤال
After carrying out the following two statements, sales will have been created as a one- dimensional array that can hold 20 double values.
After carrying out the following two statements, <sup>sales</sup><sup> </sup>will have been created as a one- dimensional array that can hold 20 <sup>double</sup><sup> </sup>values.  <div style=padding-top: 35px>
سؤال
A one- dimensional array can only store elements of a single data type, but a two- dimensional array can hold data of two different data types.
سؤال
The following array definition is legal because C++ allows arrays to be implicitly sized.
The following array definition is legal because C++ allows arrays to be implicitly sized.  <div style=padding-top: 35px>
سؤال
In C++ If you attempt to store more data in an array than it can hold, the compiler will issue an error.
سؤال
C++ allows a vector to be created with no elements in it.
سؤال
C++ allows arrays to have more than two dimensions.
سؤال
An element of a two- dimensional array is referenced by the array name and two subscripts, first the element row number and then the element column number.
سؤال
If a C++ program contains the following array definition
If a C++ program contains the following array definition  <div style=padding-top: 35px>
سؤال
An individual array element can be processed or passed to a function just like a regular C++ variable.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/37
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 8: Arrays
1
To add up all the values in a two- dimensional array it would be best to use

A)one for loop
B)one sentinel controlled loop
C)two separate for loops
D)a nested for loop
E)no loop
D
2
If the scores array is defined like this: <strong>If the <sup>scores</sup><sup> </sup>array is defined like this:  </strong> A)7 B)8 C)4 D)9 E)the first four scores

A)7
B)8
C)4
D)9
E)the first four scores
D
3
When an array is passed to a function, it is actually _ the array that is/are passed.

A)the data type and size of
B)the value stored in the first element of
C)the starting memory address of
D)a copy of all the values in
E)none of the above
C
4
To step through a one- dimensional array, accessing the elements one by one, it would be most appropriate to use loop.

A)a nested loop
B)an infinite
C)no
D)a sentinel controlled loop
E)a for loop
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
5
If you leave out the size declarator in an array declaration

A)the array will contain no elements.
B)the value of each array element is set to a default value of 0.
C)the array size defaults to 100 elements.
D)the array cannot be created.
E)you must furnish an initialization list.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
6
An array can store a group of values, but the values must be

A)all the same data type.
B)numeric, not characters or strings.
C)declared at the time the array is created.
D)constants.
E)none of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
7
By using the same you can build relationships between data stored in two or more arrays.

A)arguments
B)subscript
C)array name
D)data type
E)data
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
8
The statement typedef int oneDArray[20];
Does which of the following?

A)creates an array of 20 integers
B)makes oneDArray an alias for a data type that holds 20 integers
C)creates a one- dimensional integer array with all elements initialized to 20
D)makes oneDArray a copy of another 20- integer array
E)none of the above
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
9
You can assign the contents of one array to another by using

A)both array names.
B)the equality operator.
C)the assignment operator.
D)A and C together.
E)none of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
10
When a relationship is established between two or more arrays by using the same subscript to relate entries between the arrays, the arrays are called arrays.

A)indexed
B)paired
C)parallel
D)linked
E)brother
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
11
When you pass an array as an argument to a function, the function can modify the contents of the array.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
12
A two- dimensional array can be viewed as

A)a table with rows and columns.
B)two columns of indexes.
C)two rows of values.
D)any of the above.
E)none of the above.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
13
When an array is passed to a function, it is actually the array that is passed.

A)the data type and name of
B)a copy of all the values in
C)the starting memory address of
D)the value stored in the first element of
E)the data type and size of
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
14
C++ allows array elements to be class objects provided they are all instances of the same class.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
15
To access an array element, use the array name and the element's

A)value.
B)name.
C)data type.
D)size declarator.
E)subscript.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
16
Subscript numbering in C++

A)can begin with a programmer- defined value.
B)automatically begins with zero.
C)can be set at run time.
D)automatically begins with one.
E)varies from program to program.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
17
The statement <strong>The statement   is an example of</strong> A)an illegal array declaration. B)an illegal array initialization. C)data encapsulation. D)default arguments. E)implicit array sizing. is an example of

A)an illegal array declaration.
B)an illegal array initialization.
C)data encapsulation.
D)default arguments.
E)implicit array sizing.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
18
Unlike regular variables, arrays can hold multiple

A)data types.
B)values.
C)variables.
D)named constants.
E)operators.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
19
A one- dimensional array can be initialized at the time it is defined, but a two- dimensional array cannot be.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
20
Assuming employee is an array of objects with a public member function named
setHourlyWage, the following statement correctly calls this method for employee[2].
Assuming <sup>employee</sup><sup> </sup>is an array of objects with a public member function named <sup>setHourlyWage</sup>, the following statement correctly calls this method for <sup>employee[2]</sup>.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
21
The following statement adds a new element to a the department vector at index 25.
The following statement adds a new element to a the <sup>department</sup><sup> </sup>vector at index 25.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
22
The following statement is a valid C++ array definition.
The following statement is a valid C++ array definition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
23
The amount of memory used by an array depends upon the array's data type and how many elements in the array currently have data stored in them.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
24
To assign the entire contents of one array to another, you can use the assignment operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
25
Each individual element of an array can be accessed by the array name and an element number, called a subscript.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
26
When you create a vector it is unnecessary to specify how many elements it will hold because it will expand in size as you add new values to it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
27
The following statement initializes all five elements of the number array to 1.
The following statement initializes all five elements of the <sup>number</sup><sup> </sup>array to 1.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
28
The amount of memory used by an array depends solely on the number of elements the array can hold.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
29
After carrying out the following two statements, sales will have been created as a one- dimensional array that can hold 20 double values.
After carrying out the following two statements, <sup>sales</sup><sup> </sup>will have been created as a one- dimensional array that can hold 20 <sup>double</sup><sup> </sup>values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
30
A one- dimensional array can only store elements of a single data type, but a two- dimensional array can hold data of two different data types.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
31
The following array definition is legal because C++ allows arrays to be implicitly sized.
The following array definition is legal because C++ allows arrays to be implicitly sized.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
32
In C++ If you attempt to store more data in an array than it can hold, the compiler will issue an error.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
33
C++ allows a vector to be created with no elements in it.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
34
C++ allows arrays to have more than two dimensions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
35
An element of a two- dimensional array is referenced by the array name and two subscripts, first the element row number and then the element column number.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
36
If a C++ program contains the following array definition
If a C++ program contains the following array definition
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
37
An individual array element can be processed or passed to a function just like a regular C++ variable.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 37 في هذه المجموعة.