Created
September 26, 2011 21:06
-
-
Save russ/1243409 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
#!/usr/bin/env ruby | |
require "rubygems" | |
require "highline/import" | |
interval = ask("What time interval?", Integer) { |q| q.default = 15 } | |
amount = ask("What is the charge?", Integer) { |q| q.default = 1 } | |
capacity = ask("What is the capacity?", Integer) { |q| q.default = 15 } | |
average_hours_per_day = ask("Average number of hours per day?", Integer) { |q| q.default = 7 } | |
per_hour = (amount * interval) * capacity | |
per_day = per_hour * average_hours_per_day | |
per_month = per_day * 30 | |
per_year = per_month * 12 | |
puts "Per Hour:\t $#{per_hour.to_s}" | |
puts "Per Day:\t $#{per_day}" | |
puts "Per Month:\t $#{per_month}" | |
puts "Per Year:\t $#{per_year}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment