I need to create a program that calculates tax, but I dont understand how to do it.
I used google translate to translate the task so it is not well written.
The only thing I have started with is this! But i need help with the rest
String tax=JOptionPane.showInputDialog("type in your tax class. (1 or 2)");
int sk=Integer.parseInt(tax);
String inntekt=JOptionPane.showInputDialog("type in your income.");
int i=Integer.parseInt(income);
The task looks like this....
Write a program that reads my tax class (1 or 2) and an income from the user (usually double) program will calculate and print the assessed taxes
In class 1 is that
If your income is below 20000, there is no tax.
If your income is greater than 20000 and less than 100,000 is 20% tax of over 20000
If your income is over 100,000, it shall be paid 20% tax on income between 20 and 100 thousand and 40% of the excess.
while Class 2 tax rates, respectively, 15 and 35% and the threshold amount is 50,000 and 150000. The program will repeat the questions and calculations arbitrarily many times. If the user enters tax class 0, then the program ends.
thanks for help