Expressions
Category: Expressions
Author: Jessica Miller and Marty Stepp
Book Chapter: 2.1
Problem: Expressions
For each expression at left, indicate its value in the right column. List a value 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) 12 / 3 + 5 + 3 * -2
2) 1 + 1 + "(1 + 1)" + 1 + 1
3) 13 / 2 - 38 / 5 / 2.0 + (15 / 10.0)
4) 11 < 3 + 4 || !(5 / 2 == 2)
5) 20 % 6 + 6 % 20 + 6 % 6