Filters
Question type

Study Flashcards

Consider a mail-order business in which customers get a discount based on the quantity they order. In writing a program to compute the discount based on a customer's order quantity, why is it not a good idea to construct an array with as many elements as a customer might want to order, and store the appropriate discount associated with each number?

Correct Answer

verifed

verified

This approach has at least three drawbac...

View Answer

When a subscript is not within the range of acceptable subscripts, it is said to be ____.


A) a superscript
B) flagged
C) out of bounds
D) indexed

E) A) and B)
F) All of the above

Correct Answer

verifed

verified

Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[5]. You know that ____.


A) numbers[1] is smaller than numbers[5]
B) there are exactly four elements between those two elements
C) numbers[5] is the last element in the array
D) there are exactly three elements between those two elements

E) A) and D)
F) A) and C)

Correct Answer

verifed

verified

A(n) ____ is another name for a subscript.


A) pointer
B) sequence
C) index
D) place holder

E) A) and B)
F) None of the above

Correct Answer

verifed

verified

One advantage to using a named constant is that the statement becomes ____.


A) self-perpetuating
B) self-documenting
C) self-referencing
D) self-mitigating

E) B) and C)
F) All of the above

Correct Answer

verifed

verified

In every programming language, when you access data stored in an array, you must use a ____ containing a value that accesses memory occupied by the array.


A) superscript
B) subscript
C) key
D) condition

E) A) and B)
F) B) and D)

Correct Answer

verifed

verified

Arrays cannot be used if you need to search for a range of values.

A) True
B) False

Correct Answer

verifed

verified

Many newer programming languages such as C++, Java, and C# use the square bracket notation for arrays.

A) True
B) False

Correct Answer

verifed

verified

All array elements have the same ____________________ name, but each individual element also has a unique subscript indicating how far away it is from the first element.

Correct Answer

verifed

verified

The number of bytes in an array is always a multiple of the number of ____ in an array.


A) subscripts
B) elements
C) iterators
D) indexes

E) None of the above
F) A) and B)

Correct Answer

verifed

verified

Providing array values is sometimes called ____.


A) creating the array
B) declaring the array
C) accumulating the array
D) populating the array

E) C) and D)
F) A) and D)

Correct Answer

verifed

verified

Showing 41 - 51 of 51

Related Exams

Show Answer