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