Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.text.DecimalFormat;
- import java.util.Scanner;
- public class Salary {
- public static void main(String[] args){
- Scanner scanner = new Scanner(System.in);
- System.out.print("Days of work = ");
- double daysOfWork = scanner.nextDouble();
- System.out.print("Day salary = ");
- double daySalary = scanner.nextDouble();
- System.out.print("Rate USD = ");
- double rateUSD = scanner.nextDouble();
- double monthSalary = daysOfWork * daySalary;
- double bonus = monthSalary * 2.5;
- double yearSalary = monthSalary * 12 + bonus;
- double taxes = yearSalary * 0.25;
- double grossSalary = yearSalary - taxes;
- double averageDay = grossSalary / 365;
- double usdToBGN = averageDay * rateUSD;
- DecimalFormat decimalFormat = new DecimalFormat("#.##");
- System.out.print(decimalFormat.format(usdToBGN));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement