Skip to content

Instantly share code, notes, and snippets.

@aguayma
Created January 15, 2015 01:08
Show Gist options
  • Save aguayma/db63ddee56ad5ff2de59 to your computer and use it in GitHub Desktop.
Save aguayma/db63ddee56ad5ff2de59 to your computer and use it in GitHub Desktop.
Wheres the beef?
puts "How much is the bill?"
bill = gets.to_f
puts "The bill is $#{bill}"
puts "How would you like to pay? Visa, Amex, Diners Club?"
pay = gets.chomp
puts "Peasant!! We don't take #{pay}!"
puts "Either way...how much tip percent would you like to add? 5%, 10%, or 20%?"
case gets.chomp
when "20%", "20"
puts "Your new total is Well thank you sir!"
tip = 0.20
when "10%", "10"
puts "Oh.....no....you shouldn't have. Really."
tip = 0.10
when "5%", "5"
puts "I FART IN YOUR GENERAL DIRECTION!"
tip = 0.05
else
tip = 0.15
end
new_total = bill + (bill *tip)
puts "Well your new total is #{new_total}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment