# First problem: Program that asks each part of someone's name individually,
# then greets with whole name.
puts 'Hi, what is your first name?'
fname = gets.chomp
puts 'And your middle name?'
mname = gets.chomp
puts 'And your last name?'
lname = gets.chomp
puts 'Well, nice to meet you, ' + fname + ' ' + mname + ' ' + lname + '.'
puts 'My name is Ruby. I\'m very cute, don\'t you think? :*'
#Second problem: Ruby thinks you two are meant for each other.
puts 'So, ' + fname + ', what is your favorite number?'
fnum = gets.chomp
puts 'You like the number ' + fnum + '?'
rnum = fnum.to_i + 1
puts 'Funny, because ' + rnum.to_s + ' is my lucky number.'
puts 'We must be made for each other!'
puts 'RUBY. NOT EVEN ONCE.'
No comments:
Post a Comment