CMSC 104, Sections 3, 4, & 5, Fall 2012
Exam 2 Topic List
- Basic review of topics from first part of course
- The C compiler
- The 3 stages of the compilation process:
preprocessing, compilation, linking
- How to run the compiler
- What the "-Wall" and the "-o" options do
- Reserved keywords: what the concept is
(not specific ones, other than ones we've used, e.g.:
"while", "return")
- Identifiers
- Legal vs. following conventions
- Variables in C
- Types
- Declaring type of variable
- Some basic types: float, int, char, double
- Structure of a basic C program
- CMSC 104 programming standards
- Preprocessor directives
- Arithmetic operators
- *, /, +, -, %
- Type promotion in expressions
- Precedence and associativity
- Relational operators
- if/else-if/else
- Boolean expressions:
- Logical opeators (||, &&, !)
- "true" and "false" in C
- treatment of numbers as true/false
- treatment of true/false as numbers
- assignment operators
- +=, -=, etc.
- auto-increment, auto-decrement, post- and pre- (x++, ++x, x--, --x)
- Input, output
- printf(), formatted output
- scanf(), reading int, floats, strings, chars
- getchar()
- Loops
- while loop
- for loop
- syntax of for loop
- when do the 3 parts get done?
- do-while
- How to decide which loop type to use
- break and continue in loops
- Sentinel values
- priming reads
- Counter-controlled loops vs. event-controlled loops
- switch statements
- Incremental programming