Created
August 8, 2009 16:48
-
-
Save sween/164454 to your computer and use it in GitHub Desktop.
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
# This program will convert how much xbox points are per point. | |
# Quentin Sweeney's first Ruby program. 08/08/2009 | |
# numofpoints (variable) divided by(operator) the cost(variable) | |
puts "################################" | |
puts "## XBOX Actual Cost ##" | |
puts "################################" | |
puts " by oO Sween Oo" | |
puts "How many points are you going to buy?" | |
numofpoints = gets.chomp | |
puts "How much is it?" | |
cost = gets.chomp | |
answer = cost.to_i / numofpoints.to_f | |
puts "The cost per point Quentin is: " + answer.to_s | |
puts "How many points is the item you want to buy?" | |
realpoints = gets.chomp | |
realcost = realpoints.to_i * answer | |
puts "The cost of this in real money is: " + realcost.to_s |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment