Skip to content
AgileLogics
Intermediate 5 min read

Intermediate Projects

Prerequisites: Level 2 — Intermediate

Build these using the STL, smart pointers, and RAII from Level 2.

1. Contact Book with STL Containers

Model a Contact struct (name, phone, email) stored in a std::vector<Contact>, with a std::unordered_map<std::string, size_t> index for fast lookup by name. Support add/find/remove, and sort the full list by name using std::sort with a lambda comparator.

2. Smart-Pointer Shape Collection

Rebuild Level 1's Shape hierarchy project using std::vector<std::unique_ptr<Shape>> instead of raw pointers, so every shape is freed automatically — verify with a destructor that logs when each shape is destroyed.

3. Simple Text-Based Database

Model a Record class with RAII-managed file persistence (open in the constructor, save and close in the destructor). Support add/query/delete, using std::map for in-memory storage between saves.

4. Custom Exception Hierarchy

Design a small AppException base class (deriving from std::exception) with specific subclasses (ValidationException, NotFoundException), and use them throughout a small inventory or contact-book-style program.