Guest User

Untitled

a guest
Aug 4th, 2018
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. package Exams;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class salary {
  6. public static void main(String[] args){
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. double salary = Double.parseDouble(scanner.nextLine());
  10. int time = Integer.parseInt(scanner.nextLine());
  11. String member = scanner.nextLine();
  12.  
  13.  
  14.  
  15. for(int i = 1 ; i <= time; i++){
  16. salary += salary * 0.06;
  17. if(i % 5 == 0){
  18. salary += 100;
  19. }
  20. if(i % 10 == 0){
  21. salary += 100;
  22. }
  23. if(member.equals("Yes") && i % 5 != 0 && i % 10 != 0){
  24. salary *= 0.99;
  25. }
  26.  
  27. if(salary >= 5000){
  28. System.out.printf("Current salary: 5000.00");
  29. return;
  30. }
  31.  
  32. }
  33.  
  34. System.out.printf("Current salary: %.2f%n", salary);
  35. System.out.printf("%d more years to max salary", ?????);
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment