Advertisement
Spocoman

Bonus Score

Sep 2nd, 2024
474
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 Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int number = Integer.parseInt(scanner.nextLine());
  7.         double bonus = 0;
  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.  
  17.         if (number % 2 == 0) {
  18.             bonus++;
  19.         } else if (number % 10 == 5) {
  20.             bonus += 2;
  21.         }
  22.  
  23.         System.out.printf("%f\n%f\n", bonus, number + bonus);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement