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") |
NewerOlder