Expressions
Category: Expressions
Author: Marty Stepp and Benson Limketkai
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 (e.g., 7.0 rather than 7 for a double, Strings in "quotes").
1) 1 + 2 * 3 - 4 * 5
2) 5 / 2 + 9.0 / 2.0 - 2 * 1.25
3) 29 % 2 % 5 + 34 % 3
4) 8 + 6 * -2 + 4 + "0" + (2 + 5)
5) 31 / 2 / 10.0 + 10 / (5 / 2.0)