1
0
Fork 0
lrthw/exercises/ex12.rb

18 lines
370 B
Ruby

print "Give me a number: "
number = gets.chomp.to_i
bigger = number * 100
puts "A bigger number is #{bigger}."
print "Give me another number: "
another = gets.chomp
number = another.to_i
smaller = number / 100
puts "A smaller number is #{smaller}."
print "Give me some money! $"
money = gets.chomp.to_f
puts "You can have 10% back: $#{(money / 100 * 10).round(2)}"