Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Created by User on 23.3.2017 г..
- */ import java.util.Scanner;
- public class Bonus {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- System.out.print("Enter score: ");
- double num = Double.parseDouble(scanner.nextLine());
- double bonusScore = 0.0;
- if (num <= 100)
- bonusScore = 5;
- else
- if (num > 100 && num <= 999)
- bonusScore = (num * 0.20) ;
- else
- if (num > 1000)
- bonusScore = (num * 0.10) ;
- if (num % 10 == 5)
- bonusScore += 2;
- if (num % 2 == 0) {
- bonusScore += 1;
- System.out.println("Bonus score: " + bonusScore);
- System.out.println("Total score: " + (num + bonusScore));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement