Advertisement
Kancho

Untitled

Jan 21st, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Bunuses_Points {
  4. public static void main(String[] args) {
  5.  
  6.  
  7. Scanner keyboard = new Scanner(System.in);
  8. System.out.print("Enter points: ");
  9. int points = keyboard.nextInt();
  10. double bonus = 0;
  11. if (points <= 100) {
  12. bonus = 5;
  13. } else if (points > 1000) {
  14. bonus = points * 0.1;
  15. } else if (points > 100) {
  16. bonus = points * 0.2;
  17. }
  18. if (points % 2 == 0) {
  19. bonus += 1;//bonus = bonus + 1;
  20. } else if (points % 10 == 5) {
  21. bonus += 2;//bonus = bonus + 2;
  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