RULES
1.
Use the precedence rules to help you evaluate the Boolean expression in the single line comment above the tricky variable.
Then, set the boolean variable tricky equal to the result (either true or false).
public class GeneralizationsB {
public static void main(String args) {
// ( 3 >= 3 && !(true || true) )
boolean tricky ()
if(2015 < 2016) {
System.out.println("Stuck in the past...");
}else {
System.out.println("Upgraded to the future!");
}
int subwayTrain = 9;
switch (subwayTrain){
case 1 : System.out.println("This is a South Ferry bound train!");
break;
case 5 : System.out.println("This is a Brooklyn bound train!");
break;
case 7 : System.out.println("This is a Queens bound train!");
break;
default:
System.out.println("I'm not sure where that train goes...");
}
}
First step tells you to evaluate step by step given Boolean expression 3 >= 3 && !(true || true), next you assign variable tricky to the right result either true or false.
This is the line from your posted code that you are working on for this step:
boolean tricky ()
The exercise wants you to assign a value to tricky. To assign value you would start out like this, using the assignment operator =:
boolean tricky =
Do you see the word boolean there? That is the type of value that you are expected to use. There are only two boolean values that you can choose: true or false.
How do you know which one to use? You can go at that several ways:
You can evaluate the expression that the exercise is asking you to evaluate or you could guess.
There are a couple ways to evaluate the expression. You can work it out yourself or you can ask the computer to do it for you.