Created
February 18, 2014 18:50
-
-
Save eveadele/9077262 to your computer and use it in GitHub Desktop.
Cash Register 1 - Eve and Jake
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 "Welcome to the mean coffeeshop. What is the amount due?" | |
amount_due = gets.chomp.to_f | |
puts "What is the amount tendered?" | |
amount_tendered = gets.chomp.to_f | |
if amount_tendered < amount_due | |
puts "You owe me an additional $#{format("%.2f", amount_due - amount_tendered)} or I will break your kneecaps." | |
else | |
puts "===Thank You!===" | |
puts "The total change due is $#{format("%.2f", amount_tendered - amount_due)}" | |
puts "Transaction completed on " + Time.now.strftime("%m/%d/%Y %I:%M%p") | |
puts "================" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment