mswi12

Bonus Score

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