

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A set of programming quiz questions for a cse 8a course, focusing on java programming concepts such as loops, conditional statements, and arrays. Students are required to determine the output of given code snippets and identify which loops will not cause an arrayindexoutofbounds exception.
Typology: Quizzes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


int x = 0; int y = 5;
while ( x < 10 && y <= 7 ) { x++; y++; System.out.println( x + " " + y ); }
System.out.println( x + " " + y );
int x = 2; int y = 5;
while ( x < 3 || y <= 6 ) { System.out.println( x + " " + y ); x++; y++; }
System.out.println( x + " " + y );
Sound noise = new Sound( FileChooser.pickAFile() ); SoundSample[] foo = noise.getSamples();
A) for ( int i = 16; i < this.getWidth(); i++ )
B) for ( int i = this.getWidth() – 16; i > 0; i-- )
C) for ( int i = -1; i < this.getWidth(); i++ )
D) for ( int i = 0; i <= this.getWidth(); i++ )
E) for ( int i = this.getWidth(); i > 0; i-- )
F) for ( int i = this.getWidth() – 1; i >= 0; i-- )