Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class DailyEarnings {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int workDays = Integer.parseInt(scanner.nextLine());
- double dailyIncome = Double.parseDouble(scanner.nextLine());
- double exchangeRate = Double.parseDouble(scanner.nextLine());
- // 1 месечна заплата = 21 * 75 = 1575 долара.
- double monthlyIncome = workDays * dailyIncome;
- // Годишен доход = 1575 * 12 + 1575 * 2.5 = 22837.5 долара.
- double yearlyIncome = monthlyIncome * 12 + monthlyIncome * 2.5;
- // Данък = 25% от 22837.5 = 5709.375 лева.
- double taxes = yearlyIncome * 0.25;
- // Чист годишен доход = 17128.125 долара = 27233.71875 лева.
- double IncomeAfterTaxesAnnually = (yearlyIncome - taxes) * exchangeRate;
- // Средна печалба на ден = 27233.71875 / 365 = 74.61 лева.
- double AverageDailyIncome = IncomeAfterTaxesAnnually / 365;
- System.out.printf("%.2f", AverageDailyIncome);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement