Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer the following questions: 1. Keys in a Ruby Hash can be__. A.String type only B. Integer type only C. String and integer type only

Answer the following questions:

1. Keys in a Ruby Hash can be__.

A.String type only
B. Integer type only
C. String and integer type only

D. Any Ruby object type

2.

Given the following hash:

names = Hash["a" => "Marc", "b" => "Cheyenne", "c" => "Alexander", "d" => Mia]

Which one of the following returns "true"?

A. names.has_key?(Mia")
B. names.has_key?(a)
C. names.has_key(Marc)
D.

names.has_key?(a")

3.

Please fill the blanks.

names._____ do |key, _____| puts "#{key} is #{value}" end
A. each; value
B merge; value
C each; =>
D

merge; =>

4. True or False. We can "rocket" a key to more than one value in a hash.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago