Theory Exam 1 Theory Exam 1
Registration opens: | Thursday, August 30 |
---|---|
Exam starts: | Thursday, September 13 |
Exam ends: | Sunday, September 16 |
Overview of “Theory Exam 1”
Exam 1 is designed to explore the foundational concepts of C++ and is worth 70 points.
Exam 1 contains only multiple choice or short answer problems. You will not be required to write any standalone code outside of the PrairieLearn web interface.
Topics Covered
Topics from lecture:
- Classes in C++
- Public members functions
- Private helper functions
- Private variables
- Constructors
- Automatic default constructor
- Custom constructors (default and non-default)
- Copy constructor
- Automatic copy constructor
- Custom copy constructor
- Namespaces in C++
- Creating a class that is part of a namespace (eg:
Cube
is part of thecs225
namespace) - Using a class from a namespace (eg:
cs225::Cube
) - Purpose and usefulness of namespaces
- Creating a class that is part of a namespace (eg:
- Variables
- Four properties: name, type, location (in memory), and value
- Primitive vs. user-defined
- Memory
- Indirection in C++:
- Reference variables
- Pointers
- Differences and trade-offs between each type
- Stack memory
- Heap memory
- Functions: Calling and Returning
- Pass by value, by reference, and by pointer
- Return by value, by reference, and by pointer
Assignments referenced:
- lab_intro
- lab_debug
- MP1