Created
November 9, 2017 01:13
-
-
Save Dasms/0ad50f7cc1735c1ec9b43c369ccfa37c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
print "What is your name? " | |
name = gets.chomp | |
puts "Alright #{name} what would you like to buy today? | |
We currently have a beach ball, a tennis ball and a giraffe. | |
The beach ball is 12.99, the tennis ball is 4.99 and the | |
giraffe is 93.86. You currently have $120. " | |
purchase = gets.chomp | |
if purchase == "tennis ball" | |
price = 4.99 | |
end | |
if purchase == "beach ball" | |
price = 12.99 | |
end | |
if purchase == "giraffe" | |
price = 93.86 | |
end | |
puts "Alright #{name}, that will be #{price}" | |
puts "Here is your change of #{120 - price}, and a great day!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment