@@ -0,0 +1,973 @@
+package java_problems.beginner;%0D%0A%0D%0Aimport java.util.Locale;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0Apublic class GrossSalary %7B%0D%0A%0D%0A%09public static void main(String%5B%5D args) %7B%0D%0A%09%09%0D%0A%09%09Scanner sc = new Scanner(System.in);%0D%0A%09%09int numCases = Integer.parseInt(sc.nextLine());%0D%0A%09%09for (int i = 0; i %3C numCases; i++) %7B%0D%0A%09%09%09int salary = sc.nextInt();%0D%0A%09%09%09double grossSalary;%0D%0A%09%09%09if (salary %3C 1500) %7B%0D%0A%09%09%09%09grossSalary = salary + salary;%0D%0A%09%09%09%7D else %7B%0D%0A%09%09%09%09grossSalary = salary + 500 + (0.98 * salary);%0D%0A%09%09%09%7D%0D%0A%09%09%09System.out.println(cppPrintFormat(salary, grossSalary));%0D%0A%09%09%7D%0D%0A%09%09sc.close();%0D%0A%09%7D%0D%0A%09%0D%0A%09private static String cppPrintFormat(int s, double sal) %7B%0D%0A%09%09double m = s / 100.0 - 50275 / 100.0;%0D%0A%09%09int w = (int) m;%0D%0A%09%09double d=m-w;%0D%0A%09%09if ((m %3E= 0.0) && (Math.abs(d - 0.0) %3C 0.01)) %7B%0D%0A%09%09%09return (String.valueOf((int) sal));%0D%0A%09%09%7D else %7B%0D%0A%09%09%09String salStr = String.format(Locale.ENGLISH, %22%25g%22, sal);%0D%0A%09%09%09return (salStr.indexOf('.') %3C 0 ? salStr%0D%0A%09%09%09%09%09: salStr.replaceAll(%22%5C%5C.?0+$%22, %22%22));%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%7D

Add GrossSalary