Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Number10
- {
- public static void main(String[] args) {
- Scanner input = new Scanner (System.in);
- double salary, raise = 0, service, newSalary = 0;
- System.out.println("Please enter your current salary: $ ");
- salary = input.nextDouble();
- System.out.println("Please enter how many years you have been with the company: ");
- service = input.nextDouble();
- if (service < 10) {
- raise = salary * 0.05;
- newSalary = salary + raise;
- }
- else
- if (service >= 10 && service <= 20) {
- raise = salary * 0.1;
- newSalary = salary + raise;
- }
- else
- if (service > 20) {
- raise = salary * 0.15;
- newSalary = salary + raise;
- }
- System.out.println("Projected Salary: $" +newSalary);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement