# brandenbeaman/cps architecture

> Architecture diagram of the GitHub repository brandenbeaman/cps, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/brandenbeaman/cps
- Repository: https://github.com/brandenbeaman/cps

## Overview

This repository is a collection of four independent C++ lab programs, not one integrated application. Their user-facing workflows are: process numbers from a selected file and report Harshad status; demonstrate Q10p6 fixed-point conversions and arithmetic; create passengers and manage a cabin manifest; and load a used-car inventory for interactive searches. The graph separates these products and shows their main runtime stages. Lab 5’s vehicle base-class details and Lab 3’s implementation are represented only as far as the tree and sampled source support.

Main entry points: [`Lab_5/Lab_5.cpp`](https://github.com/brandenbeaman/cps/blob/main/Lab_5/Lab_5.cpp) (Inventory and Search), [`Lab_2/Lab_2.cpp`](https://github.com/brandenbeaman/cps/blob/main/Lab_2/Lab_2.cpp) (File Processor), [`Lab_4/Lab_4.cpp`](https://github.com/brandenbeaman/cps/blob/main/Lab_4/Lab_4.cpp) (Manifest Menu), [`Lab_4/Manifest.cpp`](https://github.com/brandenbeaman/cps/blob/main/Lab_4/Manifest.cpp) (Manifest Collection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_harshad["Harshad Processor"]
  node_h_main["File Processor<br/>[Lab_2.cpp]"]
  node_h_helpers["File and Number Helpers<br/>[harshad.cpp]"]
  node_h_input["Number Input"]
  node_h_output["Status Output"]
end

subgraph group_fixed["Fixed Point Demo"]
  node_q_main["Q10p6 Demo<br/>[Lab_3.cpp]"]
  node_q_class["Q10p6 Arithmetic<br/>[Q10p6.cpp]"]
end

subgraph group_manifest["Passenger Manifest"]
  node_p_main["Manifest Menu<br/>[Lab_4.cpp]"]
  node_p_passenger["Passenger Record<br/>[passenger.cpp]"]
  node_p_manifest["Manifest Collection<br/>[Manifest.cpp]"]
end

subgraph group_vehicles["Vehicle Search"]
  node_v_main["Inventory and Search<br/>[Lab_5.cpp]"]
  node_v_inventory["Vehicle Inventory<br/>[Inventory.txt]"]
  node_v_base["Vehicle Interface<br/>[Vehicle.h]"]
  node_v_gas["Gas Vehicle<br/>[GasVehicle.cpp]"]
  node_v_electric["Electric Vehicle"]
end

node_h_user(("User"))
node_p_user(("User"))
node_v_user(("User"))

node_h_user -->|"selects file"| node_h_main
node_h_main -->|"checks filename"| node_h_helpers
node_h_main -->|"reads numbers"| node_h_input
node_h_main -->|"checks Harshad"| node_h_helpers
node_h_main -->|"writes results"| node_h_output
node_q_main -->|"constructs and operates"| node_q_class
node_p_user -->|"enters commands"| node_p_main
node_p_main -->|"validates and sets"| node_p_passenger
node_p_main -->|"adds, removes, prints"| node_p_manifest
node_p_manifest -->|"reads passenger info"| node_p_passenger
node_v_user -->|"searches inventory"| node_v_main
node_v_main -->|"loads records"| node_v_inventory
node_v_main -->|"creates and configures"| node_v_gas
node_v_main -->|"creates and configures"| node_v_electric
node_v_main -->|"searches vehicle records"| node_v_base
node_v_main -->|"formats matching specs"| node_v_gas
node_v_main -->|"formats matching specs"| node_v_electric

click node_h_main "https://github.com/brandenbeaman/cps/blob/main/Lab_2/Lab_2.cpp"
click node_h_helpers "https://github.com/brandenbeaman/cps/blob/main/Lab_2/harshad.cpp"
click node_q_main "https://github.com/brandenbeaman/cps/blob/main/Lab_3/Lab_3/Lab_3.cpp"
click node_q_class "https://github.com/brandenbeaman/cps/blob/main/Lab_3/Lab_3/Q10p6.cpp"
click node_p_main "https://github.com/brandenbeaman/cps/blob/main/Lab_4/Lab_4.cpp"
click node_p_passenger "https://github.com/brandenbeaman/cps/blob/main/Lab_4/passenger.cpp"
click node_p_manifest "https://github.com/brandenbeaman/cps/blob/main/Lab_4/Manifest.cpp"
click node_v_main "https://github.com/brandenbeaman/cps/blob/main/Lab_5/Lab_5.cpp"
click node_v_inventory "https://github.com/brandenbeaman/cps/blob/main/Lab_5/Inventory.txt"
click node_v_base "https://github.com/brandenbeaman/cps/blob/main/Lab_5/Vehicle.h"
click node_v_gas "https://github.com/brandenbeaman/cps/blob/main/Lab_5/GasVehicle.cpp"
click node_v_electric "https://github.com/brandenbeaman/cps/blob/main/Lab_5/ElectricVehicle.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_h_main,node_h_helpers,node_h_input,node_h_output,node_h_user,node_p_user,node_v_user toneBlue
class node_q_main,node_q_class toneAmber
class node_p_main,node_p_passenger,node_p_manifest toneMint
class node_v_main,node_v_inventory,node_v_base,node_v_gas,node_v_electric toneRose
```

## Components

### Harshad Processor

- [File Processor](https://github.com/brandenbeaman/cps/blob/main/Lab_2/Lab_2.cpp): `Lab_2/Lab_2.cpp`
- [File and Number Helpers](https://github.com/brandenbeaman/cps/blob/main/Lab_2/harshad.cpp): `Lab_2/harshad.cpp`
- **Number Input**
- **Status Output**

### Fixed Point Demo

- [Q10p6 Demo](https://github.com/brandenbeaman/cps/blob/main/Lab_3/Lab_3/Lab_3.cpp): `Lab_3/Lab_3/Lab_3.cpp`
- [Q10p6 Arithmetic](https://github.com/brandenbeaman/cps/blob/main/Lab_3/Lab_3/Q10p6.cpp): `Lab_3/Lab_3/Q10p6.cpp`

### Passenger Manifest

- [Manifest Menu](https://github.com/brandenbeaman/cps/blob/main/Lab_4/Lab_4.cpp): `Lab_4/Lab_4.cpp`
- [Passenger Record](https://github.com/brandenbeaman/cps/blob/main/Lab_4/passenger.cpp): `Lab_4/passenger.cpp`
- [Manifest Collection](https://github.com/brandenbeaman/cps/blob/main/Lab_4/Manifest.cpp): `Lab_4/Manifest.cpp`

### Vehicle Search

- [Inventory and Search](https://github.com/brandenbeaman/cps/blob/main/Lab_5/Lab_5.cpp): `Lab_5/Lab_5.cpp`
- [Vehicle Inventory](https://github.com/brandenbeaman/cps/blob/main/Lab_5/Inventory.txt): `Lab_5/Inventory.txt`
- [Vehicle Interface](https://github.com/brandenbeaman/cps/blob/main/Lab_5/Vehicle.h): `Lab_5/Vehicle.h`
- [Gas Vehicle](https://github.com/brandenbeaman/cps/blob/main/Lab_5/GasVehicle.cpp): `Lab_5/GasVehicle.cpp`
- [Electric Vehicle](https://github.com/brandenbeaman/cps/blob/main/Lab_5/ElectricVehicle.cpp): `Lab_5/ElectricVehicle.cpp`

### Other components

- **User**
- **User**
- **User**

## Connections

- User → File Processor: selects file
- File Processor → File and Number Helpers: checks filename
- File Processor → Number Input: reads numbers
- File Processor → File and Number Helpers: checks Harshad
- File Processor → Status Output: writes results
- Q10p6 Demo → Q10p6 Arithmetic: constructs and operates
- User → Manifest Menu: enters commands
- Manifest Menu → Passenger Record: validates and sets
- Manifest Menu → Manifest Collection: adds, removes, prints
- Manifest Collection → Passenger Record: reads passenger info
- User → Inventory and Search: searches inventory
- Inventory and Search → Vehicle Inventory: loads records
- Inventory and Search → Gas Vehicle: creates and configures
- Inventory and Search → Electric Vehicle: creates and configures
- Inventory and Search → Vehicle Interface: searches vehicle records
- Inventory and Search → Gas Vehicle: formats matching specs
- Inventory and Search → Electric Vehicle: formats matching specs
