Practice-It! logo

BJP3 Self-Check 2.4: expressions3

Added by: Leslie Ferguson on 2013/04/01
Keywords: expressions, String

Trace the evaluation of the following expressions, and give their resulting values. Make sure to give a value of the appropriate type (such as including a .0 at the end of a double or quotes around a String).

2 + 2 + 3 + 4
"2 + 2 " + 3 + 4
2 + " 2 + 3 " + 4
3 + 4 + " 2 + 2"
"2 + 2 " + (3 + 4)
"(2 + 2) " + (3 + 4)
"hello 34 " + 2 * 4
2 + "(int) 2.0" + 2 * 2 + 2
4 + 1 + 9 + "." + (-3 + 10) + 11 / 3
8 + 6 * -2 + 4 + "0" + (2 + 5)
1 + 1 + "8 - 2" + (8 - 2) + 1 + 1
5 + 2 + "(1 + 1)" + 4 + 2 * 3
"1" + 2 + 3 + "4" + 5 * 6 + "7" + (8 + 9)

You must log in before you can solve this problem.

user
Log In

If you do not understand how to solve a problem or why your solution code doesn't work, please contact your TA or instructor.

If something seems wrong with the Practice-It system itself (errors, slow performance, incorrect problem descriptions/tests, etc.), please contact us.

Is there a problem?
Contact a Practice-It administrator.