Skip to content

Instantly share code, notes, and snippets.

@sween
Created August 8, 2009 16:48
Show Gist options
  • Save sween/164454 to your computer and use it in GitHub Desktop.
Save sween/164454 to your computer and use it in GitHub Desktop.
# 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