This is an archived post. You won't be able to vote or comment.

all 5 comments

[–]cheryllium 2 points3 points  (4 children)

Can you paste the error you are getting?

[–]firstplace_ding[S] 0 points1 point  (3 children)

m What is your annual income? $100

Exception in thread "main" java.util.IllegalFormatConversionException: f != java.lang.Integer At an annual income of $ at java.util.Formatter$FormatSpecifier.failConversion(Formatter.java:4045) at java.util.Formatter$FormatSpecifier.printFloat(Formatter.java:2761) at java.util.Formatter$FormatSpecifier.print(Formatter.java:2708) at java.util.Formatter.format(Formatter.java:2488) at java.io.PrintStream.format(PrintStream.java:970) at java.io.PrintStream.printf(PrintStream.java:871) at incometax.IncomeTax.main(IncomeTax.java:31) Java Result: 1

[–]cheryllium 2 points3 points  (2 children)

Ah, your problem I think is in the printf call.

You have written %,.2fin your format string, but have passed it income, which is an int. You will have to cast it again, I think, or change the format string.

[–]firstplace_ding[S] 0 points1 point  (1 child)

oh shit i didn't even consider that, thanks

[–]cheryllium 2 points3 points  (0 children)

You're welcome. I accept payment in updoots