Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. package testExam;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Test14 {
  6. public static void main(String[] args) {
  7. Scanner scanner = new Scanner(System.in);
  8.  
  9. int n = Integer.parseInt(scanner.nextLine());
  10.  
  11. double bonus = 0 ;
  12.  
  13. if ( n <=100){
  14. bonus+=5;
  15. }else if (n >1000){
  16. bonus = n * 0.10;
  17.  
  18. }else if ( n > 100 || n<1000){
  19. bonus = n * 0.20;
  20. }
  21.  
  22. if (n % 2 == 0 ){
  23. bonus+=1;
  24. }
  25. if (n % 10 == 5){
  26. bonus+=2;
  27. }
  28. System.out.printf("%.1f\n",bonus);
  29. System.out.printf("%.1f",bonus+n);
  30.  
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement