Week 9 - Defining Types (Enums, Typedef, and Structs)
Learning objectives
Upon finishing this learning module, you should be able to:
- Use enums and typedefs to improve code readability and safety
- Use structs to represent heterogeneous collections of data
Suggested Schedule
Day 1
- Enums, Typedef & Namespaces
- Do Enum CPPLab
Day 2
- Structs
- Do Struct CPPLab
Day 3
- Structs and arrays
- Intro final assignment
Day 4
- Holiday
Activity Outline
Enums & Typedef
Read learncpp.com's enum page and the book's online enum supplement
Read leancpp.com's Typedef page
This video adds a couple important points about enums and typedef's—watch it after reading the pages listed above:
Do Enums CPPLab
Structs
Read learncpp.com's struct page
These videos cover structs and introduce some concepts that are not covered in the reading. This first one should be enough to prepare you for the CPPLab.
Do Structs CPPLab
This video demonstrates managing more complex data by combining structs and arrays. It will help get you ready for the last assignment.
Assignment
Start working on the last major assignment. Because this is the final assignment, the deadline will work a little differently. It is due the Monday of finals week and no late work will be accepted. This assignment does require a bit of work to get set up and going, so be sure to start early.