-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash_practice_problems.rb
More file actions
48 lines (20 loc) · 1.45 KB
/
Copy pathhash_practice_problems.rb
File metadata and controls
48 lines (20 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 1. Make a hash to store a person's first name, last name, and email address. Then print each attribute on separate lines.
puts "Problem One:"
# 2. Make an array of hashes to store the first name and last name for 3 different people. Then print out the first person's info.
puts "Problem Two:"
# 3. Make a hash to store prices for 3 different menu items. Then add a new menu item and price and print the hash to see the result.
puts "Problem Three:"
# 4. Make a hash to store a book's title, author, number of pages, and language. Then print each attribute on separate lines.
puts "Problem Four:"
# 5. Make an array of hashes to store the title and author for 3 different books. Then print out the third book's author.
puts "Problem Five:"
# 6. Make a hash to store 3 different states and their captitals. Then add a new state and capital and print the hash to see the result.
puts "Problem Six:"
# 7. Make a hash to store a laptop's brand, model, and year. Then print each attribute on separate lines.
puts "Problem Seven:"
# 8. Make an array of hashes to store the brand and model for 3 different laptops. Then print out the second laptop's model.
puts "Problem Eight:"
# 9. Make a hash to store definitions for 2 different words. Then add a new word and definition and print the hash to see the result.
puts "Problem Nine:"
# 10. Make a hash to store a shirt's brand, color, and size. Then print each attribute on separate lines.
puts "Problem Ten:"