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 score = Integer.parseInt(scanner.nextLine());
- double bonusScore = 0.0;
- if (score <= 100) {
- bonusScore += 5;
- } else if (score>100 && score<=1000) {
- bonusScore += score*0.2;
- } else if (score>1000) {
- bonusScore += score*0.1;
- }
- if (score%2==0){
- bonusScore+=1;
- }
- if (score%10==5) {
- bonusScore+=2;
- }
- System.out.println(bonusScore);
- System.out.println(score+bonusScore);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement