ch06Sections1-5 - 1 6.14 Exercises, Problems, and Projects...

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

View Full Document Right Arrow Icon
6.14 Exercises, Problems, and Projects 6.14.1 Multiple Choice Exercises 1. The code runs forever. 2. d o/while loop 3. It is a count-controlled loop. 4. true 6.14.2 Reading and Understanding Code 5. Enter an int > 3 Hello Enter an int > 5 Hello Enter an int > -1 6. Hello Enter an int > 3 Hello Enter an int > 5 Hello Enter an int > -1 7. Enter an int > 3 Enter an int > 5 Hello Enter an int > -1 Hello 8 . i is 20 and sum is 54 9. i is 9 and product is 336 10. i is 8 and product is 42 11. Hello Hello Hello Done 12. Hello Hello Hello Done 13. 3 14. 2034 15. i is 5 and sum is 10 16. i is 40 and sum is 60 17. 30 18. 40 19. 3 3 3 3 4 AF_CH06.doc Page 1 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
20. i is 7 and sum is 21 6.14.3 Fill in the Code 21. while( i != 5 ) { System.out.println( i ); i = (int) ( 5 * Math.random( ) + 3 ); } 22. System.out.print( "Enter an integer > " ); int value = scan.nextInt( ); while ( value != 20 ) { if (value >= start) System.out.println( value ); System.out.print( "Enter an integer > " ); value = scan.nextInt( );
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 10/05/2011 for the course CS 38 taught by Professor Stevehouseman during the Summer '09 term at Irvine Valley College.

Page1 / 3

ch06Sections1-5 - 1 6.14 Exercises, Problems, and Projects...

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