CSE 123C.001 3-3-08

CSE 123C.001 3-3-08 - CSE 123C 3 March 2008 Midterms (from...

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

View Full Document Right Arrow Icon
CSE 123C 3 March 2008 Midterms (from 2-29-08) will be graded and grades posted on HuskyCT by Friday In addition to the slides on HuskyCT Int i=1 int sum = 0; while ( i<10) { i ++ ; } Can be converted directly to: For (int i=1; i<0; i++) { sum+=I; } For=counter controlled loop Initialize, test, execute, increment/decrement Increment happens first (doesn’t matter if it’s pre increment or post increment) 3 parts are optional, but you need to have the info elsewhere and you still need the semicolon (will always have two semicolons in the for expression), commas enable you to do multiple things at the end of the loop How to decide which type of loop to use: What piece of code needs to be repeated What piece of code needs to be done only once o Is it done before or after the repeated part 1 2 3 3 parts of the loop Controls how many times the
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

CSE 123C.001 3-3-08 - CSE 123C 3 March 2008 Midterms (from...

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