Created
January 14, 2015 22:15
-
-
Save aguayma/06ee3c8882e69dfca8cb to your computer and use it in GitHub Desktop.
How was your meal?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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%" | |
puts "Your new total is Well thank you sir!" | |
tip = 0.20 | |
when "10%" | |
puts "Oh.....no....you shouldn't have. Really." | |
tip = 0.10 | |
when "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