Advertisement
thotfrnk

selection4.java

Nov 11th, 2022
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. import java.util.Scanner;
  2. public class Number10
  3. {
  4.     public static void main(String[] args) {
  5.        
  6.         Scanner input = new Scanner (System.in);
  7.        
  8.         double salary, raise = 0, service, newSalary = 0;
  9.        
  10.         System.out.println("Please enter your current salary: $ ");
  11.         salary = input.nextDouble();
  12.        
  13.         System.out.println("Please enter how many years you have been with the company: ");
  14.         service = input.nextDouble();
  15.        
  16.         if (service < 10) {
  17.             raise = salary * 0.05;
  18.             newSalary = salary + raise;
  19.         }
  20.         else
  21.             if (service >= 10 && service <= 20) {
  22.                 raise = salary * 0.1;
  23.                 newSalary = salary + raise;
  24.             }
  25.         else
  26.             if (service > 20) {
  27.                 raise = salary * 0.15;
  28.                 newSalary = salary + raise;
  29.             }
  30.         System.out.println("Projected Salary: $" +newSalary);    
  31.        
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement