Advertisement
galinyotsev123

ProgBasicsJavaBook3.1SimpleConditions06BonusScore

Jan 22nd, 2019
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 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.  
  7. int num = Integer.parseInt(scanner.nextLine());
  8. double points = 0;
  9.  
  10. if (num <= 100) {
  11. points += 5;
  12. } else if (num > 100 && num <= 1000) {
  13. points = num * 0.2;
  14. } else if (num > 1000) {
  15. points = num * 0.1;
  16. }
  17. if (num % 2 == 0) {
  18. points += 1;
  19. } else if (num % 5 == 0) {
  20. points += 2;
  21. }
  22. System.out.println(points);
  23. System.out.println(points + num);
  24.  
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement