Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package ConditionalStatements.Exercise;
- 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 bonus = 0;
- if (points <= 100){
- bonus = bonus + 5;
- }else if (points > 100 && points <= 1000){
- bonus = bonus + (points * 0.2);
- }else if (points > 1000){
- bonus = bonus + (points * 0.1);
- }
- if (points % 2 == 0){
- bonus = bonus + 1;
- }else if (points %10 == 5){
- bonus = bonus + 2;
- }
- System.out.println(bonus);
- System.out.println(points + bonus);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement