How brianalong/cplusplus-program works
Project type and purpose
• This is a multi‐application C++ repository (CS210 course assignments) containing four standalone console apps:
• Clock App
• Calculator App
• Banking App
• Inventory App
• Each app is a command‐line program that presents a text‐menu UI, performs computations or data operations, and (where applicable) persists data (e.g., inventory or banking records) to disk.
File structure
• Top‐level directory holds four ZIP archives, each packaging one app’s source files, plus README.md.
• main.cpp (entry point, menu loop)
• one or more .cpp/.h pairs for core functionality (e.g., Calculator.cpp/h, InventoryManager.cpp/h)
• possibly a simple file‐I/O utility or data model (e.g., Record.h)
• No web servers, no databases—just console I/O and file storage.
README for additional insights
• Describes the apps’ purpose (client utilities for Chada Tech).
• Indicates opportunities for refactoring (extract common code into shared modules, improve menu duplication).
a. Main components (per app)
• User (Console)
• Presentation Layer (Menu & CLI parsing)
• Business Logic Layer (App‐specific services: clock calculations, arithmetic engine, account operations, inventory CRUD)
• Data Access Layer (File I/O modules for persistence)
• Shared Common Module (proposed refactoring target for menu logic)
b. Relationships & Interactions
• User → Presentation Layer: selects menu options
• Presentation Layer → Business Logic: invokes service functions
• Business Logic → Data Access: reads/writes persistent records
• Business Logic → Presentation Layer: returns results/status for display
• All apps → (optional) Shared Common Module: use common menu routines
c. Architectural patterns & design principles
• Layered Architecture: clearly separate CLI, core logic, and file I/O
• DRY Principle: identify and extract repeated menu code into a common library
• Single Responsibility: each class/module handles one concern (e.g., Calculator vs. MenuHandler)
d. Technologies & libraries
• C++17 (or newer) standard library (iostream, fstream, chrono)
• Build tools (Makefile, if any) or manual compile commands
• Third‐party references (none in current state, but consider a small argument parser or JSON lib if extending)