// *************************************************************** // Salary.java // // Computes the amount of a raise and the new // salary for an employee. The current salary // and a performance rating (an int, 1 to 10) are input. // *************************************************************** import java.util.Scanner; import java.text.NumberFormat; public class Salary { public static void main (String[] args) { double currentSalary; // employee's current salary double raise; // amount of the raise double newSalary; // new salary for the employee int rating; // performance rating Scanner scan = new Scanner(System.in); System.out.print ("Enter the current salary: "); currentSalary = scan.nextDouble(); System.out.print ("Enter the performance rating (1 to 10): "); rating = scan.nextInt(); // Compute the raise using if statements // Compute the new Salary // Print the results NumberFormat money = NumberFormat.getCurrencyInstance(); System.out.println(); System.out.println("Current Salary: " + money.format(currentSalary)); System.out.println("Amount of raise: " + money.format(raise)); System.out.println("New salary: " + money.format(newSalary)); System.out.println(); } }