Expressions
Category: Expressions
Author: Marty Stepp and Helene Martin
Book Chapter: 2.1
Problem: Expressions
For each expression in the left-hand column, indicate its value in the right-hand column. Be sure to list a constant of appropriate type and capitalization. e.g., 7 for an int, 7.0 for a double, "hello" for a String, true or false for a boolean.
1) 1 + 9 / 2 * 2.0
2) 5.0 / (3125 % 2) + 2 * (5 / 3)
3) 6 % 17 + 9 % 3 + 22 / 4 / 2.0
4) "[" + 2 + 4 * 2.0 + "]" + 3-1
5) !(3 < 2) && (4.3 > 3 || 3 < 2)