Advertisement
desislava_topuzakova

BonusScore

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