Created
October 11, 2012 06:54
-
-
Save rubyginner/3870660 to your computer and use it in GitHub Desktop.
Calculate remaining VL and SL
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
#calculate remaining VL and SL | |
def remaining_leaves(vl_taken, sl_taken) | |
month_now = Time.now.month | |
vl_remaining = ((month_now.to_f*1.25) - vl_taken.to_i) | |
sl_remaining = ((month_now.to_f*1.25) - sl_taken.to_i) | |
return "Remaining VL: #{vl_remaining.to_f} Remaining SL: #{sl_remaining.to_f}" | |
end | |
puts "How many VLs have you taken? " | |
my_vl = gets.chomp | |
puts "How many SLs have you taken? " | |
my_sl = gets.chomp | |
puts "#{remaining_leaves(my_vl,my_sl)}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment