H
Hd Pwnz0r
puts "What is the total?"
input = gets.chomp.to_i
puts "What percent do you want to tip?"
input2 = gets.chomp.to_i
percent = 100
tip = input2 * input * 0.01
puts "You should tip $#{tip}"
This is a tip calculator. I want it to work if the person enters $45 or
15%.
Right now, it would only return 0 because they are invalid numbers. It
would only work with an input of 15 or 45. I have really no clue how to
do that.
input = gets.chomp.to_i
puts "What percent do you want to tip?"
input2 = gets.chomp.to_i
percent = 100
tip = input2 * input * 0.01
puts "You should tip $#{tip}"
This is a tip calculator. I want it to work if the person enters $45 or
15%.
Right now, it would only return 0 because they are invalid numbers. It
would only work with an input of 15 or 45. I have really no clue how to
do that.