Theory Exam 1 Theory Exam 1
Registration opens: | Thursday, January 18 |
---|---|
Exam starts: | Tuesday, January 30 |
Exam ends: | Friday, February 2 |
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
- Namespaces in C++
- Creating a class that is part of a namespace (eg:
Sphere
is part of thecs225
namespace) - Using a class from a namespace (eg:
cs225::Sphere
) - 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