Advertisement
tchenkov

L03u06_BonusScore

Jan 18th, 2017
377
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. /*
  4.  * Created by todor on 17.01.2017 г..
  5.  */
  6. public class u06_BonusScore {
  7.     public static void main(String[] args) {
  8.  
  9.         Scanner scan = new Scanner(System.in);
  10.  
  11.         int num = Integer.parseInt(scan.nextLine());
  12.         double bonus = 0;
  13.  
  14.         if (num <= 100){
  15.             bonus = 5;
  16.         }
  17.         else if ((100 < num) && (num <= 1000)){
  18.             bonus = num * 0.2;
  19.         }
  20.         else {
  21.             bonus = num * 0.1;
  22.         }
  23.  
  24.         if (num % 2 == 0){
  25.             bonus += 1;
  26.         }
  27.         else if (num % 10 == 5){
  28.             bonus += 2;
  29.         }
  30.  
  31.         System.out.println(bonus);
  32.  
  33.         double numPlusBonus = num + bonus;
  34.         System.out.println(numPlusBonus);
  35.     }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement