Untitled

Run Settings
LanguageRuby
Language Version
Run Command
a = 12.85 b = a * 1.5 c = a * 2 x = 38.4 y = 0 z = 0 f = 0.06 m = 0.0145 t = 0.13 d = ((a * x) + (b * y) + (c * z)).round(2) w = (d - ((f * d) + (m * d) + (t * d))).round(2) q = ((f * d) + (m * d) + (t * d)).round(2) mo = w * 4 yp = w * 52 print "Pay \n" puts d puts "\n" print "Taxes \n" puts (d * f).round(2) puts (d * m).round(2) puts (d * t).round(2) puts "\n" print "Actual \n" puts w print "Monthly\n" puts mo puts "\n" print "Yearly \n" puts d * 52 puts (yp).round(2) puts ((d * 52) - yp).round(2) if w >= 250 print "Pass \n" else puts "Fail" end if w <= 100 print "Not enough!" else puts "Save some!" end list = 5, 6, 7, 8, 9, 10 list1 = 3, 4, 5, 6, 7, 8 puts "\n" puts "These are the different overtime hour possibilitys #{list}" puts "These are the different doubletime hour possibilitys #{list1}" list.each_with_index do |hours| puts "This is the number of over time hours #{hours} " end puts "\n" list.each do |hours| ot_with_taxes = (((a * x) + (b * hours) + (c * z)) - q).round(2) puts "With #{hours} over time hours the total pay is #{ot_with_taxes}" puts "\n" end puts "\n" print "Double Time \n" list1.each do |double| dt = double ot = dt * 4 - 2 double_with_taxes = (((a * x) + (b * ot ) + (c * dt)) - q).round(2) puts "With #{dt} double time hours and #{ot} over time hours the total pay is #{double_with_taxes}" puts "\n" end results = [] # [ # [13, 3, 10, 662.38], # [9, 4, 5, 591.7] #] list1.each do |double| list.each do |hours| dt = double # ot = dt * 4 - 2 double_with_taxes = (((a * x) + (b * hours ) + (c * dt)) - q).round(2) comphours = hours + dt results << [comphours, dt, hours, double_with_taxes] puts "\n" puts "#{comphours} Total Overtime Hours" puts "With #{dt} double time hours and #{hours} over time hours the total pay is #{double_with_taxes} \n" if hours + dt >= 15 print "Carefull \n" else print "Not enough \n" end if double_with_taxes >= 400 print "Worth it \n" else print "Not worth it \n" end end end puts ">>>>>>" sorted = results.sort { |result| result[0] } sorted.each do |result| # [comphours, dt, hours, double_with_taxes] puts result[0] end
Editor Settings
Theme
Key bindings
Full width
Lines