# ogpulpy/cgpacalc architecture

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

- Interactive diagram: https://gitdiagram.com/ogpulpy/cgpacalc
- Repository: https://github.com/ogpulpy/cgpacalc

## Overview

##### Project type and purpose
- This is a simple, single-module Java command-line application whose sole purpose is to calculate a student’s Cumulative Grade Point Average (CGPA).
- Key indicators: only two source files named CGPACalculator.java (the core logic) and Main.java (the entry point), no web or GUI folders, and a minimal README.

##### File structure
- Top-level artifacts:
- .gitignore – standard VCS ignore file
- .idea/ & CGPA.iml – IntelliJ IDEA project metadata
- README.md – basic project description
- src/ – source code directory containing:
– Main.java
– CGPACalculator.java
- There is no persistence or external service integration evident; it’s a pure in-memory console app.

##### README for additional insights
- The README has no architecture details or external dependencies; it simply invites code review.
- No references to frameworks (Maven, Gradle), databases, or APIs.

a. Main components
- User (Console) – external actor
- Presentation Layer (Main.java) – handles user input/output
- Business Logic Layer (CGPACalculator.java) – performs CGPA computation
b. Relationships and interactions
1. User enters grades/credits in Console
2. Main.java reads input and calls CGPACalculator.calculate(...)
3. CGPACalculator processes data and returns a CGPA value
4. Main.java outputs the result back to the Console
c. Architectural patterns / design principles
- Layered (separation of concerns between input/output and computation)
- Single-responsibility principle: Main.java only handles I/O; CGPACalculator.java only handles calculation
d. Relevant technologies / frameworks
- Java SE (console I/O via java.util.Scanner and System.out)
- IDE metadata (IntelliJ IDEA)
- Plain javac/java for build and run (no build tool detected)

## Diagram (Mermaid)

```mermaid
flowchart TB
    User["User (Console)"]:::external
    subgraph "Presentation Layer"
        Main["Main.java"]:::internal
    end
    subgraph "Business Logic Layer"
        Calculator["CGPACalculator.java"]:::internal
    end
    User -->|"enter grades/credits"| Main
    Main -->|"calculateCGPA()"| Calculator
    Calculator -->|"CGPA result"| Main
    Main -->|"display result"| User

    click Main "https://github.com/ogpulpy/cgpacalc/blob/master/src/Main.java"
    click Calculator "https://github.com/ogpulpy/cgpacalc/blob/master/src/CGPACalculator.java"

    classDef internal fill:#ADD8E6,stroke:#333,stroke-width:1px
    classDef external fill:#90EE90,stroke:#333,stroke-width:1px
```
