Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package S2_ConditionalStatements;
- import java.util.Scanner;
- public class BonusScore {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int points = Integer.parseInt(scanner.nextLine());
- double bonusPoints = 0;
- if (points <= 100) {
- bonusPoints = 5;
- } else if (points <= 1000) {
- bonusPoints = points * 0.20;
- } else if (points > 1000) {
- bonusPoints = points * 0.10;
- }
- if (points % 2 == 0) {
- bonusPoints = bonusPoints + 1;
- } else if(points % 10 == 5) {
- bonusPoints = bonusPoints + 2;
- }
- System.out.println(bonusPoints);
- System.out.println(bonusPoints + points);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement