Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def label(num)
- puts "--------"
- puts " part #{num} "
- puts "--------"
- end
- # part 1
- label(1)
- puts "#{hpy = 365 * 24} hours in a year"
- puts "#{hpy * 10 * 60} minutes in a decade"
- puts "I am #{hpy * 24 * 60 * 60} seconds old"
- # part 2
- label(2)
- puts "#{x = 1031000000} seconds old is #{x / 365 / 24 / 60 / 60} years old"
- # part 3
- label(3)
- print "First name: "
- first = gets.chomp
- print "Middle name: "
- middle = gets.chomp
- print "Last name: "
- last = gets.chomp
- puts "Hello, #{first} #{middle} #{last}."
- print "What is your favorite number? "
- num = gets.chomp
- puts "That's a decent number, but wouldn't you rather prefer #{num.to_i + 1}? It's bigger and nicer."
- # part 4
- label(4)
- print "Whaddaya want?! "
- s = gets.chomp
- puts "WHADDAYA MEAN \"#{s.upcase}\"?!? YOU'RE FIRED!!"
Advertisement
Add Comment
Please, Sign In to add comment