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 console = new Scanner(System.in);
- double n = Double.parseDouble(console.nextLine());
- double bonus = 0;
- if (n <= 100) {
- bonus += 5;
- }
- else if (n > 100 && n <= 1000) {
- bonus = ((n * 20) / 100);
- }
- else if (n > 1000) {
- bonus = ((n * 10) / 100);
- }
- if (n % 2 == 0) {
- bonus += 1;
- }
- else if (n % 10 == 5) {
- bonus += 2;
- }
- double result = n + bonus;
- System.out.println("Bonus score: " + bonus);
- System.out.println("Total score: " + result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment