midterm cheat sheet

midterm cheat sheet - cin.ignore(1000, \n) Strings...

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

View Full Document Right Arrow Icon
Variables - must start with letter -only letters/ #s/ underscore && has higher precedence than || -in an array, extra slots will be initialized with values 0 Double 10^38 15 sig figs Characters -cannot be empty -doing ‘a’ makes the character a into an integer. can be useful in this example: -uppercase is always less than lowercase -a is less than c bool isVowel(char v) { switch (v) { case ’a’: case ’e’: case ’i’: break; //will leave switch statement case ’o’: case ’u’: return true; default: return false; } } Integers -during cin, won’t consume whitespace after you it enter. add
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.

Unformatted text preview: cin.ignore(1000, \n) Strings monthNames[m-1] // not allowed, only const ints inside allowed #include<iostream> using namespace std; cout.setf(ios::fixed); cout.precision(2); cin >> cout << for( ; ; ) if() continue; //skips rest of current iteration static_cast<double>(n) while: initialization while(condition) statement //usually includes a ++ of some sort do-while: do { statement // will always be executed at least once } while (condition);...
View Full Document

Page1 / 2

midterm cheat sheet - cin.ignore(1000, \n) Strings...

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