package week4; public class Salary { /* * A sales representative in a book distribution company receives $200 per week salary, plus 5% commissions for any sale that exceeds $200. Also, $50 bonus is paid at the end of the week if sales for this week is more than $2000. Write a program that prompts a user for representative name and weekly sales for the current week and calculates and displays the representative’s salary Input : User input for representative name and weekly sales Process:if sales > 200 than commission = 5% of sales if sales > 2000 than bonus = 50 weekly salary = 200 + commission + bonus Output:prints out the representative’s salary with name, commision,bonus, weekly sary and total salary */ public static void main(String[] args) { // Get the representative name and weekly sales from user java.util.Scanner scanner = new java.util.Scanner(System.in); System.out.print("Enter the representative name: "); String name = scanner.nextLine(); System.out.print("Enter the weekly sales: "); double sales = scanner.nextDouble(); scanner.close(); // Process double commission = 0; double bonus = 0; if (sales > 200) { commission = sales * 0.05; } if (sales > 2000) { bonus = 50; } double weeklySalary = 200 + commission + bonus; // Output System.out.println("Representative Name: " + name); System.out.println("Commission: $" + commission); System.out.println("Bonus: $" + bonus); System.out.println("Weekly Salary: $" + weeklySalary); System.out.println("Total Salary: $" + (200 + commission + bonus)); } }