Quiz2.fa09

Quiz2.fa09 - Signature _ cs11f _ CSE 11 Quiz 2 Fall 2009...

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

View Full Document Right Arrow Icon
Signature _____________________ CSE 11 Name ________________________ Quiz 2 cs11f ____ Fall 2009 Student ID ____________________ This quiz is to be taken by yourself with closed books, closed notes, no calculators. (Partial) Operator Precedence Table Operators Associativity * / % left to right + - left to right < <= > >= left to right == != left to right && left to right || left to right = right to left 1) What is the output of this code? (Circle correct letter.) public class Test1 { public static void main(String[] args) { int x = 1; if (x < 2) System.out.print("Hello, "); if (x > 1) System.out.print("How are you? "); else System.out.println("I am fine."); } } 2) Which of the statements below is logically equivalent to the if-conditional: if( !P && Q ) Assume for any two independent statements P and Q . (Circle correct letter.) A. if( !!P || Q ) B. if( !(P || !Q) ) C. D. 3) What is the value of Nag after the assignment statement below? (Circle correct letter.)
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/07/2011 for the course CSE CSE11 taught by Professor Cs during the Spring '10 term at UCSD.

Page1 / 2

Quiz2.fa09 - Signature _ cs11f _ CSE 11 Quiz 2 Fall 2009...

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

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