10-QualityProgramming

10-QualityProgramming - quality programming think...

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

View Full Document Right Arrow Icon
quality programming think everything thru
Background image of page 1

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

View Full DocumentRight Arrow Icon
initializing arrays, switch, short, long, break, continue, return = functions( );
Background image of page 2
init arrays int z[5] = { 0, 0, 0, 0, 0}; string names [3] = {“gary”, “frank”, “sue”};
Background image of page 3

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

View Full DocumentRight Arrow Icon
break // leaves a loop while (true ) { if (x == 0) { break; } // goes to here }
Background image of page 4
continue // continues a loop while ( true ) { // goes to here if (x == 0) { continue; } }
Background image of page 5

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

View Full DocumentRight Arrow Icon
an example char userInput = ' '; // init to a blank while (true ) { cout << "Type q to quit: "; cin >> userInput; if (userInput == 'q') { break; } // end if else { cout << "Keep going" << endl; continue; } // end else } // end while
Background image of page 6
instead of ifs, else if, etc. . int x; switch (x ) { case( 0 ): { // code break; } case( 1 ): { // code break; } case( 2 ): { // code break; } default: { // code break; } } // end switch
Background image of page 7

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

View Full DocumentRight Arrow Icon
computers store numbers in memory … memory is not unlimited double : 10.4 : has two parts to be stored int : 14 : has one part short x; : x is a small integer number long x; : x is a large integer number int x; : ?
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 11/03/2011 for the course EAS 230 at SUNY Buffalo.

Page1 / 19

10-QualityProgramming - quality programming think...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online