Ivakis

Дневна печалба

Sep 21st, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int days = Integer.parseInt(scanner.nextLine());
  8. double dayPayment = Double.parseDouble(scanner.nextLine());
  9. double course = Double.parseDouble(scanner.nextLine());
  10.  
  11. double monthSalary = dayPayment * days;
  12. double anualSalary = monthSalary * 12;
  13. double bonus = monthSalary * 2.5;
  14. double totalSalary = anualSalary + bonus;
  15.  
  16. double tax = totalSalary * 0.25;
  17.  
  18. double netSalaryUsd = totalSalary - tax;
  19. double netSalaryLv = netSalaryUsd * course;
  20.  
  21. double result = netSalaryLv / 365;
  22.  
  23. System.out.printf("%.2f", result);
  24.  
  25. }
  26. }
Add Comment
Please, Sign In to add comment