{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Midterm.wi11

# Midterm.wi11 - Signature Name cs8w Student ID CSE 8A...

This preview shows pages 1–4. Sign up to view the full content.

Signature _____________________ Name ________________________ cs8w ____ Student ID ____________________ CSE 8A Midterm Winter 2011 Page 1 ___________ (13 points) Page 2 ___________ (17 points) Page 3 ___________ (16 points) Page 4 ___________ (20 points) Page 5 ___________ (8 points) Page 6 ___________ (19 points) Total ___________ (93 points = 88 base points + 5 points EC [>5%]) (88 points = 100%) This exam is to be taken by yourself with closed books, closed notes, no electronic devices. You are allowed one side of an 8.5"x11" sheet of paper handwritten by you.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
1 (Partial) Operator Precedence Table Operators Associativity ! ++ -- (pre & post inc/dec) right to left * / % left to right + - left to right < <= > >= left to right == != left to right && left to right || left to right = right to left Which of the following are valid Java identifiers? (Circle your answer(s).) quarter_.25 Half-Time 25Cents double quarter25 SuperBowl_XLV QUARTER_25 string_cheese What does the statement System.out.println( "The answer is: " + (3 + 2) + 1 ); print? ________________________________ What does the statement System.out.println( 3 <= 2 ); print? ________________________________ What does int x = 20 % 3; System.out.println( x ); print? ________________________________ What does the statement System.out.println( "The answer is: " + 3 + 2 + 1 ); print? ________________________________ What gets printed? public class M2 { public static void main( String[] args ) { System.out.println( -1 + 2 - 3 * 5 / 4 ); _________ System.out.println( 6 + 7 % 11 + 9 * 10 ); _________ } } What is printed by the following code? int foo = 37; int bar = 42; boolean foobar = ( foo == bar ); System.out.println( foobar ); ____________ bar = 37; System.out.println( foobar ); ____________ System.out.println( foo == bar ); ____________
2

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}