Advertisement
Edzhevit

Untitled

Sep 18th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. package SimpleConditions;
  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. double num = Double.parseDouble(scanner.nextLine());
  9. double bonus = 0.0;
  10. if (num <= 100) {
  11. bonus = bonus + 5;
  12. } else if (num > 1000) {
  13. bonus = bonus + num * 0.1;
  14. } else {
  15. bonus = bonus + num * 0.2;
  16. }
  17.  
  18. if (num % 2 == 0) {
  19. bonus += 1;
  20. } else if (num % 10 == 5) {
  21. bonus += 2;
  22. }
  23. System.out.println(bonus);
  24. System.out.println(bonus + num);
  25.  
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement