Hi guys,
Having a hard time with what should be very simple assignment. Code below.
class TaxReturn { public static void main(String[] args) { // declare the variables int age = 36; boolean hasDependants = true; boolean jointReturn = true; boolean categoryA = (!hasDependants && age <= 30) || (!jointReturn); boolean categoryB = (hasDependants) || (age >= 45 && jointReturn); boolean categoryC = (age >= 30 && age <= 45) && (!jointReturn || !hasDependants); System.out.println(categoryA + categoryB + categoryC); } }
I have tried numerous things to try to get this to compile. When i put my boolean variables into separate print statements, it compiles just fine. When i try to ditch the '+' signs in an attempt to concatenate them together, and try using escape sequences instead it throws an error saying that I am missing semicolons, even though i am not. My desired output is this:
'CategoryA' = "false" 'CategoryB' = "true" 'CategoryC' = "false"
I know adding the single and double quotes require escape sequences, but those have also been somewhat problematic unfortunately, but that's another days question anyone who can help push me in the right direction towards understanding this gets a free dog online dog