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