Haidong Xue Summer 2011, at GSU Principles of Computer Programming (using Java) Chapter 4 Basic Control Structures Haidong Xue Summer 2011, at GSU
Content Quiz2 Test1 Assignment4 boolean expression if structure while structure do-while structure
Quiz 2 Some numbers # of full grades: 3 Average: 78 Answers
Test 1 Some numbers Answers # of full grades: 1 # of grades in [90, 99]: 9 # of grades in [80, 89]: 3 # of grades in [70, 79]: 8 # of grades in [0, 69]: 8 Average: 79 Answers
Assignment 4 Review of the class mechanism The answers
Boolean Expression Literals Operators Examples == != > < >= <= ! && || Examples
if structure if ( boolean expression ) { … } else if( boolean expression) //optional, could be more than 1 else // optional
while structure while( boolean expression) { … break; //optional } The counting loop: for structure
do-while structure do { … break; //optional } while( boolean expression);
Assignment if ( Test1 <= 80 ){ redo assignments 3 and 4; } else{ no assignment;