Quiz3.wi11

Quiz3.wi11 - cs8w _ Student ID _ CSE 8A Quiz 3 Winter 2011...

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

View Full Document Right Arrow Icon
cs8w ____ CSE 8A Name ________________________ Quiz 3 Student ID ____________________ Winter 2011 Signature _____________________ This quiz is to be taken by yourself with closed books, closed notes, no electronic devices. Trace the following program and specify its output. public class Trace { public static void main( String[] args ) { System.out.println( "main1" ); foo1(); System.out.println( "main2" ); foo2(); System.out.println( "main3" ); foo3(); } public static void foo1() { System.out.println( "A" ); foo2(); } public static void foo2() { foo3(); System.out.println( "B" ); } public static void foo3() { System.out.println( "C" ); } } How many times does the body of this loop execute? ________ for ( int i = 11; i > 0; --i ) { System.out.println( "CSE8A Rocks! " + i ); } With regards to the loop above, what is the last value of i that is printed? ________ Which is the correct if statement to make this code change the right half of a Picture to black? ______ public void paintItBlack()
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.

Page1 / 2

Quiz3.wi11 - cs8w _ Student ID _ CSE 8A Quiz 3 Winter 2011...

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