Exam 6: Working With Collections of Data

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Which of the following methods can be used to generate a list of hash keys?

Free
(Multiple Choice)
5.0/5
(38)
Correct Answer:
Verified

B

Unlike other types of Ruby objects, you cannot create a new array using the new method.

Free
(True/False)
4.8/5
(44)
Correct Answer:
Verified

False

You can use the Hash class's hash method to generate a list of all of the keys stored in a hash.

Free
(True/False)
4.7/5
(43)
Correct Answer:
Verified

False

An easy way to determine if a hash contains any key-value pairs is to execute the full? method.

(True/False)
4.9/5
(46)

An array's index begins at 0 and is incremented by one each time a new item it added.

(True/False)
4.9/5
(34)

Which of the following methods can be used to conditionally delete key-value pairs from a hash?

(Multiple Choice)
5.0/5
(38)

Ruby requires that the size of an array be specified when the array is defined.

(True/False)
4.9/5
(48)

In contrast to an array, the time it takes to retrieve data from a hash ____ as the hash grows in size.

(Multiple Choice)
4.7/5
(36)

Which of the following methods can be used to remove all of the items from an array?

(Multiple Choice)
4.9/5
(38)

An array is an indexed collection of key-value pairs.

(True/False)
4.9/5
(39)

The clear method can be used to remove all key-value entries from a hash.

(True/False)
4.9/5
(32)

The Hash class's delete method can be used to remove a key-value pair based on a supplied key.

(True/False)
4.7/5
(40)

As a hash grows in size it takes more and more time to process and retrieve hash key-item pairs.

(True/False)
4.9/5
(41)

Like most other programming languages, Ruby requires that an array be declared in advance of its use.

(True/False)
4.9/5
(40)

Which of the following methods can be used to retrieve the last array item?

(Multiple Choice)
4.9/5
(36)

The Array class's shift method can be used to delete the first item in an array.

(True/False)
4.8/5
(35)

Which of the following methods can be used to retrieves the first element stored in an array?

(Multiple Choice)
4.8/5
(38)

Unlike arrays, hashes are limited to storing only numeric and string data.

(True/False)
4.9/5
(25)

Which of the following methods can be used to retrieve an array item based on its index position?

(Multiple Choice)
4.9/5
(37)

The Array class's insert_at is the opposite of the delete_at method.

(True/False)
4.7/5
(37)
Showing 1 - 20 of 46
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)