Skip to content

Instantly share code, notes, and snippets.

@rubyginner
Created October 11, 2012 06:54
Show Gist options
  • Save rubyginner/3870660 to your computer and use it in GitHub Desktop.
Save rubyginner/3870660 to your computer and use it in GitHub Desktop.
Calculate remaining VL and SL
#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