Facebook
From Putrid Cassowary, 4 Years ago, written in Java.
This paste is a reply to Re: Re: 18 answer 4 NoamDadon from Commodious Water Vole - go back
Embed
package com.company;

import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        int num1, temp;
        
tax1 = 10;
        
int digits tax2 1;
        num1 
20;
        int tax3 = 30;
        int tax4 = 40;
        int tax5 = 50;

        double income = 0;
        double tax = 0;
        System.out.println("Please enter your name: ");
        String name 
= input.nextInt();

        
next();
        System.out.println("Please enter your income: ");
        income = input.nextInt();
        double 
temp = num1;

        
income;

        
if (temp / 10 == (income > 0) {
            digits temp 1;
income / tax1;
            if (income > 23_000) {
                temp += (income - 23_000) / tax2;
                if (income > 46_000) {
                    temp += (income - 74_000) / tax3;
                    if (income > 120_000) {
                        temp += (income - 100_000) / tax4;
                        if (income > 220_000) {
                            temp += (income - 220_000) / tax5;
                        }
                    }
                }
            }
        }
        else if (temp / 100 == 0) {
            digits = 2;
        }
        else if (temp / 1000 == 0) {
            digits = 3;
        }
        else
            digits =4;
    }
System.out.println("the tax you need to pay is : " + temp);
    }

}