Advertisement
veronikaaa86

[Java] 06. Bonus Score

Sep 22nd, 2017
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.69 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BonusScore {
  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.0;
  9.  
  10.         if (score <= 100) {
  11.             bonusScore += 5;
  12.         } else if (score>100 && score<=1000) {
  13.             bonusScore += score*0.2;
  14.         } else if (score>1000) {
  15.             bonusScore += score*0.1;
  16.         }
  17.  
  18.         if (score%2==0){
  19.             bonusScore+=1;
  20.         }
  21.         if (score%10==5) {
  22.             bonusScore+=2;
  23.         }
  24.         System.out.println(bonusScore);
  25.         System.out.println(score+bonusScore);
  26.     }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement