Created
November 4, 2014 18:32
-
-
Save devinrhode2/c0df8946732b2745a4b9 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 | |
loop { | |
puts "reasonable bay area salary:" #70000 | |
baySalary = baySalary || 70000 | |
baySalary = gets.to_i || baySalary || 70000 | |
puts "reasonable monthly cost for room in bay area:" #750 | |
bayRent = bayRent || 740 | |
bayRent = gets.to_i || bayRent | |
puts "reasonable monthly cost for room in Eugene: (default 370)" | |
eugeneRent = eugeneRent || 370 | |
eugeneRent = gets.to_i || eugeneRent | |
eugeneSalary = (baySalary/bayRent)*eugeneRent | |
puts "Translated salary in Eugene:#{eugeneSalary}" | |
puts "Hours per week:" | |
hoursPerWeek = hoursPerWeek || 40 | |
hoursPerWeek = gets.to_i || hoursPerWeek | |
totalHours = hoursPerWeek * (52-4) | |
puts "standard hourly wage:#{eugeneSalary/totalHours}" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment