Advertisement
GabrielHr00

02. Bonus Score

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