midterm cheat sheet 1

midterm cheat sheet 1 - Date Types: Character %c, Integer...

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

View Full Document Right Arrow Icon
Date Types: Character “%c”, Integer “%d”, Float=7 digits “%f”, double=15 digits, and int can be about 2billion Relational Operators: == (equal to), != (not equal to), < (less than), <= (less than or equal to), > (greater than), >= (greater than or equal to) Logical Operators: True and False: 0 is false and and other number is true Boolean Vaiables: we create them-do 2 things Define the bool data type, based or int Define 2 constants, true and false, with values of 1 and 0 If vs. Switch In an if statement logical statement is evaluated; in a switch statement a variable is evaluated If statement can include any data type and can be complex; switch can only be int or char Use if with floats, or if you have a range Use switch: for menus, infinite state machines. (remember both upper and lower case) While vs. For While advantage: continues as long as logical expression is ture
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 12/05/2011 for the course CSC 234 taught by Professor Hutch during the Spring '08 term at Cal Poly.

Page1 / 2

midterm cheat sheet 1 - Date Types: Character %c, Integer...

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