Midterm.wi11

Midterm.wi11 - Signature _ Name _ cs8w _ Student ID _ CSE...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
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.
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 ); ____________
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 08/31/2011 for the course CSE 8a taught by Professor Kube,p during the Fall '08 term at UCSD.

Page1 / 8

Midterm.wi11 - Signature _ Name _ cs8w _ Student ID _ CSE...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online