Advertisement
SotirovG

BonusScore_02

Sep 19th, 2020
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.03 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class BonusScore_02 {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         //Ако числото е до 100 включително, бонус точките са 5.
  7.         //Ако числото е по-голямо от 100, бонус точките са 20% от числото.
  8.         //Ако числото е по-голямо от 1000, бонус точките са 10% от числото.
  9.         //За четно число  + 1 т.
  10.         //За число, което завършва на 5  + 2 т.
  11.         double bonus = 0;
  12.         int points = Integer.parseInt(scanner.nextLine());
  13.  
  14.         if( points <= 100) bonus = + 5;
  15.         if ( points % 5 == 0) bonus = + 2;
  16.         if ( points % 2 == 0) bonus = + 1;
  17.  
  18.         if( points > 1000) bonus = points * 0.1;
  19.         if ( points >= 100) bonus = points * 0.2;
  20.  
  21.  
  22.  
  23.  
  24.         System.out.println( bonus );
  25.         System.out.println( points + bonus );
  26.  
  27.     }
  28. }
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement