-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathex5.rb
More file actions
25 lines (21 loc) · 667 Bytes
/
ex5.rb
File metadata and controls
25 lines (21 loc) · 667 Bytes
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
name = 'Zed A. Shaw'
age = 35 # not a lie in 2009
height = 74 # inches
weight = 180 #lbs
eyes = 'Blue'
teeth = 'White'
hair = 'Brown'
def inches_to_cm (inches = height)
return inches * 2.54
end
def pounds_to_kg (pounds = weight)
return pounds * 0.453592
end
puts "Let's talk about #{name}."
puts "He's #{inches_to_cm(height)} cm tall."
puts "He's #{pounds_to_kg(weight)} kg heavy."
puts "Actually that's not too heavy."
puts "He's got #{eyes} eyes and #{hair} hair."
puts "His teeth are usually #{teeth} depending on the coffee."
# this line is tricky, try to get it exactly right
puts "If I add #{age}, #{height}, and #{weight} I get #{age + height + weight}."