Advertisement
Spocoman

02. Bonus Score

Aug 24th, 2024
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 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.         int number = Integer.parseInt(scanner.nextLine());
  7.         double bonus;
  8.  
  9.         if (number <= 100) {
  10.             bonus = 5;
  11.         } else if (number > 1000) {
  12.             bonus = number * 0.1;
  13.         } else {
  14.             bonus = number * 0.2;
  15.         }
  16.         if (number % 2 == 0) {
  17.             bonus += 1;
  18.         } else if (number % 10 == 5) {
  19.             bonus += 2;
  20.         }
  21.  
  22.         System.out.printf("%f\n%f", bonus, bonus + number);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement