Advertisement
SUni2020

DailyIncome

Mar 24th, 2020
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class DailyEarnings {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int workDays = Integer.parseInt(scanner.nextLine());
  8. double dailyIncome = Double.parseDouble(scanner.nextLine());
  9. double exchangeRate = Double.parseDouble(scanner.nextLine());
  10.  
  11. // 1 месечна заплата = 21 * 75 = 1575 долара.
  12. double monthlyIncome = workDays * dailyIncome;
  13. // Годишен доход = 1575 * 12 + 1575 * 2.5 = 22837.5 долара.
  14. double yearlyIncome = monthlyIncome * 12 + monthlyIncome * 2.5;
  15.  
  16. // Данък = 25% от 22837.5 = 5709.375 лева.
  17. double taxes = yearlyIncome * 0.25;
  18. // Чист годишен доход = 17128.125 долара = 27233.71875 лева.
  19. double IncomeAfterTaxesAnnually = (yearlyIncome - taxes) * exchangeRate;
  20. // Средна печалба на ден = 27233.71875 / 365 = 74.61 лева.
  21. double AverageDailyIncome = IncomeAfterTaxesAnnually / 365;
  22.  
  23. System.out.printf("%.2f", AverageDailyIncome);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement