1.2P Hello user.docx - require'date INCHES = 39.3701 def main puts'What is your name name = gets.chomp puts'Your name is name puts'What is your family

1.2P Hello user.docx - require'date INCHES = 39.3701 def...

This preview shows page 1 out of 1 page.

require 'date' INCHES = 39.3701 def main puts 'What is your name?' name = gets.chomp puts 'Your name is ' + name + '!' puts 'What is your family name?' family_name = gets.chomp puts 'Your family name is: ' + family_name + '!' puts 'What year were you born?' year_born = gets.chomp age = Date.today.year - (year_born.to_i) puts 'So you are ' + age.to_s + ' years old'

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture