Advertisement
valiamaximova1

Bonus score

Mar 30th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.60 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class softUni2 {
  4.     public static void main(String[] args) {
  5.         Scanner scan = new Scanner(System.in);
  6.  
  7.         int n = Integer.parseInt(scan.nextLine());
  8.         double bonus =0;
  9.  
  10.         if (n <= 100){
  11.             bonus = 5;
  12.         }else if(n > 1000){
  13.             bonus = n * 0.1;
  14.         }else {
  15.             bonus = n * 0.2;
  16.  
  17.         }
  18.  
  19.         if(n % 2 == 0){
  20.             bonus = bonus + 1;
  21.         }else if (n % 10 == 5) {
  22.             bonus = bonus + 2;
  23.         }
  24.         System.out.println(bonus);
  25.         System.out.println(n + bonus);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement