1606f09labfinal.cribsheet

1606f09labfinal.cribsheet - ECOR 1606 Final Lab Test Crib...

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

View Full Document Right Arrow Icon
ECOR 1606 Crib sheet page 1 ECOR 1606 Final Lab Test Crib Sheet and Hints (Note: 2 pages long) CONTROL STRUCTURES simple if: if ( boolean exp ) { statements // body } if-then-else: if ( boolean exp ) { statements // true part } else { statements // false part } multi-way if: if ( boolean exp ) { statements // part 1 } else if ( boolean exp ) { statements // part 2 } else if ( boolean exp ) { statements // part 3 … // and so on } else { // an else part is optional statements // else part } while loop (pre-test): while ( boolean exp ) { statements // body } do-while loop (post-test): do { statements // body } while ( boolean exp ); for loop: for ( exp1 ; exp2 ; exp3 ) { statements // body } is equivalent to: exp1 ; while ( exp2 ) { same statements exp3 ; } break statement: break; – causes an exit from the enclosing loop. continue statement: continue; sends control back to the top of the enclosing loop. CALL BY … int sample (int a, int &b); “a” is call-by-value (just like a regular variable but given a value when the function is called). “b” is call-by-reference.
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/2010 for the course ECOR 1606 taught by Professor John bryant during the Fall '09 term at Carleton CA.

Page1 / 2

1606f09labfinal.cribsheet - ECOR 1606 Final Lab Test Crib...

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