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