- C++ data processing application for retail transaction analysis
- Uses STL containers and clean OOP design
- Generates frequency reports, histograms, and inventory signals
- Emphasizes maintainability, clarity, and real-world applicability
A C++ data analysis application that transforms grocery transaction data into frequency summaries and inventory insights. Built with an emphasis on clarity, maintainability, and real-world use cases.
The Corner Grocer Item Frequency Tracker analyzes daily grocery transaction records and transforms raw purchase data into structured frequency summaries and inventory insights.
The program allows users to:
- Look up how often a specific item was purchased
- View all item frequencies
- Display a text-based histogram
- Review inventory health and restock recommendations
- Automatically generate a backup data file
This project emphasizes clean C++ architecture, efficient data processing, and translating raw input into meaningful operational insights.
Retail teams can use this tool to quickly identify high-demand and low-demand products, supporting decisions around inventory planning, shelf allocation, and restocking priorities.
- Modular C++ application using STL containers to analyze transactional data
- Automated data backup and case-insensitive item lookup
- Business-focused insights such as inventory health and restock recommendations
- Project Overview
- Key Capabilities
- Technologies Used
- Program Design
- How the Program Works
- Features
- File Breakdown
- How to Run
- Example Output
- Screenshots
- Engineering Takeaways
- License
- Contact
- Language: C++17
- Concepts:
- Object-Oriented Programming
- File I/O
- STL
std::map - Input validation
- Data normalization (case-insensitive lookup)
- Tools:
- Visual Studio / VS Code
- MSVC Compiler (
cl.exe)
The application is structured around a dedicated GroceryTracker class that encapsulates all data-processing and analytics logic, while main.cpp manages user interaction and control flow.
std::map<std::string, int>is used for frequency tracking to ensure unique keys and deterministic, alphabetical output- Item names are normalized to lowercase to support user-friendly, case-insensitive searches
- Clear separation of concerns between:
- Data processing and analytics (
GroceryTracker) - User interaction and control flow (
main.cpp)
- Data processing and analytics (
This design improves readability, maintainability, and extensibility.
- Transaction data is read from an external input file at program startup
- Item names are normalized to support case-insensitive lookups
- Frequencies are stored using an STL
std::map - Users interact with the program through a menu-driven interface
- Reports and histograms are generated on demand
- A backup data file (
frequency.dat) is automatically created
Note:
The input data file is stored in a dedicateddatadirectory, and the program’s working directory is configured accordingly during execution to allow relative file access without hardcoding paths.
- Look up the frequency of a specific item
- Display all item frequencies
- Display a histogram and business insights
- Exit the program
- Inventory health scoring based on demand levels
- Identification of most- and least-purchased items
- Restock and shelf-space recommendations
- Automatic generation of
frequency.datas a backup file - Input validation to prevent invalid menu selections
| File | Purpose |
|---|---|
src/main.cpp |
Program entry point and menu logic |
src/GroceryTracker.h |
GroceryTracker class definition |
src/GroceryTracker.cpp |
GroceryTracker class implementation |
data/CS210_Project_Three_Input_File.txt |
Input transaction data |
output/frequency.dat |
Generated output file containing item frequencies |
cl src/main.cpp src/GroceryTracker.cpp /Fe:CornerGrocer.exeCornerGrocer.exeNote: The input data file is stored in a dedicated
datadirectory, and the program’s working directory is configured accordingly during execution to allow relative file access without hardcoding paths.
===== Purchase Frequency Histogram =====
apples ******** [HIGH]
cranberries ********** [HIGH]
limes * [LOW]
===== Inventory Health =====
Inventory Health Score: 70% (Moderate)
===== Restock Recommendations =====
- limes (LOW stock)
Note: Item lookup is case-insensitive for improved user experience.
Histogram and Business Insights Output
![]()
This project demonstrates practical experience in:
- Designing modular C++ applications with clear class responsibilities
- Safely handling file input/output and runtime errors
- Leveraging STL containers for efficient data processing
- Normalizing and validating user input for reliability
- Translating raw transactional data into actionable operational insights
This project is released under the MIT License and is available for review, reuse, and adaptation.
Erica Kinch
Computer Science | Data & Software Development
🔗 GitHub: github.com/ekdoestech
🔗 LinkedIn: linkedin.com/in/erica-kinch
📧 Email: ek.does.tech@gmail.com