Midterm - Study Guide
Resources and Online Notes
In addition to the material presented in Chapter's 1-5 of the textbook you may wish to look over the powerpoint hand-outs.
You can also refer to the C/C++ Reference guide at http://cppreference.com/
or you may wish to go through some of the sections (e.g. Introduction, Basics of C++, and Control Structures) of the online
tutorial available at http://www.cplusplus.com/doc/tutorial/
Topic List
Vocabulary - talking like a programmer....
Be able to answer questions such as a "What is", "Describe", "Explain", etc. or be able to write important
information about each of the following
-
main function
- Include directives, purpose, effect
- Comments, purpose of comments
- Indentation, purpose of indentation
- Compiling stages - input, output, and purpose of each stage:
preprocessor, compiler, assembler, linker
- Types of errors - name of, description of, and example of each
- 3 things a variable's type determines
- 2 categories of types
- Built-in types, general differences;
int,
char,
long,
double,
float,
bool
- Result and side effect
- Operator precedence
- Operator associativity
- Implicit conversion, rules, in general
- Explicit conversion (cast)
- true and false with regard to expressions and integer values
- Literal, string literal
- Character and string literal - difference between
- Infinite loop
- Difference between having
using namespace std,
using std::cout,
std::cout
in a program
- How the << (output) operator behaves
- How the >> (input) operator behaves
- C++ String variable type
- Functions, what are they good for
- Functions, when should you write a function
- Function call
- Function declaration/prototype
- Function definition
- Function header
- Arguments in a function call
- Formal parameters of a function
- The
return statement
- Parameter passing
- Call by value, call by reference, call by const reference; how each works, advantages, disadvantages, advantage of const reference
- Return by value, return by reference
Writing/Executing/Explaining Code - walking (coding) like a programmer...
You may be given a snipet of code to execute by hand and explain or
you may be asked to write code relating to the items below
- Writing a simple, complete C++ program that could be compiled and run
-
if, if/else, switch
-
while, for loops
- Result and side effect for preincrement, postincrement, predecrement, postdecrement
- Division of integers in C++
- Order of operations in
&& and ||
-
? : operator
- Boolean expressions, evaluation, writing, conversion of
bool values to/from integer values
- Expressions involving the following operators, and the order of evaluation of them:
++,
--,
+,
-,
*,
/,
%,
<<,
>>,
=, and assignment operators
- Conditions involving
<,
<=,
>,
>=,
==,
!=
- Understand expression evaluation including those with mixed types and the following items
- evaluating, order of evaluation
- automatic/implicit conversions, when do they happen, what happens
- casting/explicit conversion
- using casting/explicit conversion to force implicit conversion
- Show the steps in the evaluation of an expression as in the on-line examples
- Assignment operators
+=,
-=,
*=,
/=,
etc., writing, executing, rewriting as assignment with operation
- Common errors we have discussed in class
- Declaring string variables
- Using string variables
- Writing a simple function, including the declaration, definition, and a call (i.e. an invocation) of the function.
- Examples of call-by-value function parameters.
- Examples of call-by-reference function parameter.
- Examples of pass-by-value parameter passing.
- Examples of pass-by-reference parameter passing.
- Writing functions that return value through there return type
- Writing functions that can change values in the calling domain through pass by value reference