# cpe200-160/calculatorlab architecture

> Architecture diagram of the GitHub repository cpe200-160/calculatorlab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cpe200-160/calculatorlab
- Repository: https://github.com/cpe200-160/calculatorlab

## Overview

##### Project type and purpose
- This is a C#/.NET Windows Forms desktop application (a calculator) accompanied by two unit-test projects. The main goal is to provide a GUI calculator with both standard and RPN (reverse Polish notation) engines, and to validate the business logic via automated tests.

##### File structure
- Top level:
- CPE200Lab1.sln – the Visual Studio solution
- CPE200Lab1 (project) – the Windows Forms application
- CPE200Lab1Test & CPE200Lab1Tests – two separate test projects targeting the core RPN logic
- README.md – lab version history
- In CPE200Lab1:
- Program.cs – application entry point (boots the MainForm)
- MainForm.* & ExtendForm.* – presentation layer (UI)
- CalculatorEngine.cs & RPNCalculatorEngine.cs – domain/business logic layer
- App.config, Properties folder – configuration and resources
- Test projects reference RPNCalculatorEngine directly and contain test fixtures (RPNCalculatorEngineTest.cs / RPNCalculatorEngineTests.cs).

##### README for additional insights
- Lab1 added a unary operator to the existing calculator, building on previous labs.
- Focus is on extending domain logic and ensuring correctness via unit tests.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Solution
    SLN["CPE200Lab1.sln"]:::solution

    %% Application Bootstrap
    APP["Program.cs"]:::bootstrap

    %% Presentation Layer
    subgraph "Presentation Layer"
        MF["MainForm"]:::ui
        EF["ExtendForm"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        CE["CalculatorEngine.cs"]:::logic
        RPN["RPNCalculatorEngine.cs"]:::logic
    end

    %% Configuration & Resources
    subgraph "Configuration & Resources"
        CONF["App.config"]:::config
        PROPS["Properties/"]:::config
    end

    %% Test Harness
    subgraph "Test Harness"
        T1["CPE200Lab1Test"]:::test
        T2["CPE200Lab1Tests"]:::test
    end

    %% Relationships
    SLN --> APP
    APP --> MF
    APP --> EF
    MF --> CE
    MF --> RPN
    EF --> CE
    EF --> RPN
    MF --> CONF
    EF --> CONF
    MF --> PROPS
    EF --> PROPS
    T1 --> RPN
    T2 --> RPN

    %% Click Events
    click SLN "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1.sln"
    click APP "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/Program.cs"
    click MF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/MainForm.cs"
    click MF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/MainForm.Designer.cs"
    click MF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/MainForm.resx"
    click EF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/ExtendForm.cs"
    click EF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/ExtendForm.Designer.cs"
    click EF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/ExtendForm.resx"
    click CE "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/CalculatorEngine.cs"
    click RPN "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/RPNCalculatorEngine.cs"
    click CONF "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1/App.config"
    click PROPS "https://github.com/cpe200-160/calculatorlab/tree/master/CPE200Lab1/CPE200Lab1/Properties/"
    click T1 "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1Test/RPNCalculatorEngineTest.cs"
    click T1 "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1Test/CPE200Lab1Test.csproj"
    click T2 "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1Tests/RPNCalculatorEngineTests.cs"
    click T2 "https://github.com/cpe200-160/calculatorlab/blob/master/CPE200Lab1/CPE200Lab1Tests/CPE200Lab1Tests.csproj"

    %% Styles
    classDef solution fill:#D3B8AE,stroke:#855E42,color:#000;
    classDef bootstrap fill:#FFE4B5,stroke:#DAA520,color:#000;
    classDef ui fill:#ADD8E6,stroke:#5F9EA0,color:#000;
    classDef logic fill:#90EE90,stroke:#228B22,color:#000;
    classDef config fill:#D3D3D3,stroke:#696969,color:#000;
    classDef test fill:#FFDAB9,stroke:#FF8C00,color:#000;
```
