Final Exam - Study Guide
In addition to reviewing the material covered for the midterm exams you should also focus on the material presented in the lectures and labs after the midterm. The exam will be comprehensive but will have more questions from the second half of the course. The best way to study for the exam is to use the practice questions at the end of each chapter in your textbook.
Topic List
Some Important 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
- What is the difference between call-by-value and call-by reference
- When does an input stream evaluate to false?
- The two names relating to a file in a program, their meaning and purpose
- What happens when a file is opened
- what is a C-string and how is it different than a C++ string
- Array indexing
- C++ String variable type
- C++ Vector object type
-
struct
- Pointer variable
- The
* operator
- The
& operator
- The
. operator
- The
:: operator
- The 4 things to keep in mind when working with pointers.
- A pointer is a variable whose value is the address of some other variable/object or 0
- A dereferenced pointer is an alias of the object the pointer is pointing.
- If a pointer is pointing to an object of type T, then when that pointer is dereferenced it is an object of type T
- Just because we have a pointer to an abject of type T doesn't mean it can be dereferenced and used, the pointer
must be made to point to an object of type T, either an existing object or a dynamically allocated object
- Given a variable/object named
x, of type pointer to T, where T is any type,
- what does
*x in an expression or statement denote,
- what operations can be performed on/with it
- What does an array name by itself represents in an expression
- What do the functions
new and delete do
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
-
for loop
- the use of formal parameters in functions
- the formal paramters
argv and argc of main
- Arrays, index/subscript, using
for loops with arrays
- C++
string - defining, output, input, assignment, concatenation (+), append (+=), index/subscript, compare, length
- C++
string - find, substring - execute given code only
-
vectors - defining, indexing, using push_back(), size, using for loops with vectors
- Given a specification for a simple struct:
- Define the struct
- Declare data members
- Define variables for the newly defined type
- Set values of members
- Given a definition for a struct, which may contain other structs, and variable definitions, state what type of object any variable or struct member is
- Pointer variables, be able to:
- Define two variables of a given type
- Define a pointer to the same type
- Make the pointer point to the first variable
- Change the first variable's value
- Make the pointer point to the second variable
- Change the second variable's value
- Draw a diagram that depicts any of the activities above
- Use a pointer variable containing an adress returned from a call to
new