Question: IN JAVA PLEASE: 11) Suppose you have defined variables int x = 42 String y = lunchtime a) Evaluate each expression below y.equals(breakfast) 11 x

IN JAVA PLEASE:

IN JAVA PLEASE: 11) Suppose you have defined variables int x =

11) Suppose you have defined variables int x = 42 String y = "lunchtime" a) Evaluate each expression below y.equals("breakfast") 11 x != 42 x == 5 || (y.length() >0 && ! (x 0 && x > 1) || X > 2) b) Using the variables x and y above, for each phrase below, write a Java boolean expression that captures its meaning. Then determine whether the expression is true or false using the values of x and y above. x is at least 25 x is between 25 and 50, inclusive (i.e., including the endpoints of the interval) y is either 10 or 12 characters long x is equal to the three times the length of y the length of y is not divisible by 3 x is negative or else x is even and divisible by 3 y is not equal to the string "dinner" c) The method foo() from Problem 1 has three conditional statements ("if" statements). Rewrite that method so that it produces the same results, but using NO conditional statements (or any loops or tenary expressions or switch statements, etc)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!