# Edabit challenge "Convert Age to Days"
# in Ruby
# trying a new language...
def ageToDays(years)
return years * 365
end
def test(n)
puts "An age of " + n.to_s + " has passed " + ageToDays(n).to_s + " days."
end
test(1)
test(3)
test(5)
test(10)
test(89)
test(130)
No comments:
Post a Comment