Files
  • main.rb
main.rb
1
2
3
4
5
6
7
8
9
10
11
12
puts "What year were you born?"
year = gets.to_i

def calculate_age(year)
    age = 2018 - year
    return age
end

your_age = calculate_age(year)

puts "You are #{your_age}"
ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]