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