I'm coding in java and I'm curious as to why the System.out.println function is being ran twice in my if statement.
If I input "married" and "10000" in the scanner, I get the following, where everything is correct except the duplicated "Because your income is less than 15,000 and you're married, your rate is 10%":
Here is my code for both classes:
I would ideally like for any response in the "married" field to have the program return "Because you're married / unmarried, your rate is __" but any time I put it within the if statement it duplicates it for some reason. Since there's only one option for being unmarried, I was able to move the System.out.println code into the tester, but I couldn't do the same with the married option.
View on Stack Overflow
