Created
June 7, 2017 12:16
-
-
Save Szeliga/8c993226af3776141c9180f9009fc737 to your computer and use it in GitHub Desktop.
Koszta prowadzenia dzialalnosci
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
puts "Podaj dochod netto: " | |
total_income = gets.to_i | |
puts "Podaj rate leasingu netto" | |
leasing_payment = gets.to_i | |
leasing_payment_gross = (leasing_payment * 1.23).round(2) | |
vat = (leasing_payment_gross - leasing_payment).round(2) | |
puts "Rata Brutto #{leasing_payment_gross}" | |
puts "VAT #{vat}" | |
half_vat = (vat / 2.0).round(2) | |
puts "Zwrot VAT #{half_vat}" | |
tax = ((total_income - leasing_payment - half_vat) * 0.19).round(2) | |
puts "Podatek dochodowy #{tax}" | |
tax_difference = (total_income * 0.19).round(2) - tax | |
puts "Roznica podatku #{tax_difference}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment