Facebook
From Unique Marmoset, 4 Years ago, written in Java.
This paste is a reply to 18 answer 2 NoamDadon from Scanty Motmot - go back
Embed
Viewing differences between 18 answer 2 NoamDadon and Re: 18 answer 5 NoamDadon
package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
             Scanner input = new Scanner(System.in);
             final int num1, num2, num3;
     num1 
tax1 = 10;
        final int tax2 = 20;
        final int tax3 = 30;
        final int tax4 = 40;
        final int tax5 = 50;
        final int step1 = 23_000;
        final int step2 = 46_000;
        final int step3 = 74_000;
        final int step4 = 120_000;
        
        double income = 0;
        double tax = 0;
        System.out.println("Please enter your name: ");
        String name 
= input.next();
        System.out.println("Please enter your income: ");
        income = input.
nextInt();
     num2         double temp input.nextInt();
     num3 = input.nextInt();
     
income;

        
if (num1 < num2 && num2 < num3){
         
(income > 0) {
            temp = income / tax1;
            if (income > step1) {
                temp += (income - step1) / tax2;
                if (income > step2) {
                    temp += (income - step2) / tax3;
                    if (income > step3) {
                        temp += (income - step3) / tax4;
                        if (income > step4) {
                            temp += (income - step4) / tax5;
                        }
                    }
                }
            }
        }
        
System.out.println("Increasing");
     }
    }
println("the tax you need to pay is : " + temp);
    }

}