Xadez

bonusScore

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