# baraaelgendy/gpa-calculator architecture

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

- Interactive diagram: https://gitdiagram.com/baraaelgendy/gpa-calculator
- Repository: https://github.com/baraaelgendy/gpa-calculator

## Overview

This is a console GPA calculator for recording semester courses, calculating GPA or cumulative GPA, and viewing saved student results. The main menu dispatches to calculation, name-search, or all-history screens. Calculation screens collect validated input and use the student/course model to calculate grades and averages; each result is appended to History.txt. Search and history screens reload that file and present matching records or report cards. The sampled code supports the flow and persistence details; no README description or unsampled implementation details are available.

Main entry points: [`clsStudent.h`](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsStudent.h) (Student model), [`clsMainMenuUI.h`](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsMainMenuUI.h) (Main menu), [`clsCalcGPAScreen.h`](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcGPAScreen.h) (GPA screen), [`clsCalcCGPAScreen.h`](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcCGPAScreen.h) (CGPA screen)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Console interface"]
  node_menu["Main menu<br/>[clsMainMenuUI.h]"]
  node_gpa["GPA screen<br/>[clsCalcGPAScreen.h]"]
  node_cgpa["CGPA screen"]
  node_find["Find results"]
  node_historyview["History screen"]
  node_program["Application entry<br/>[GPA Calculator.cpp]"]
end

subgraph group_calculation["Calculation"]
  node_student["Student model<br/>[clsStudent.h]"]
  node_course["Course grading<br/>[clsCourse.h]"]
end

subgraph group_records["Student records"]
  node_historyfile[("Calculation history<br/>[History.txt]")]
end

subgraph group_utilities["Shared utilities"]
  node_validate["Input validation<br/>[clsInputValidate.h]"]
  node_strings["String utilities<br/>[clsString.h]"]
  node_date["Date and time<br/>[clsDate.h]"]
end

node_user(("Console user"))

node_user -->|"starts"| node_program
node_program -->|"opens"| node_menu
node_user -->|"chooses"| node_menu
node_menu -->|"validates choice"| node_validate
node_menu -->|"dispatches"| node_gpa
node_menu -->|"dispatches"| node_cgpa
node_menu -->|"dispatches"| node_find
node_menu -->|"dispatches"| node_historyview
node_gpa -->|"validates input"| node_validate
node_cgpa -->|"validates input"| node_validate
node_gpa -->|"creates and calculates"| node_student
node_cgpa -->|"creates and calculates"| node_student
node_student -->|"adds courses"| node_course
node_gpa -->|"saves result"| node_student
node_cgpa -->|"saves result"| node_student
node_student -->|"appends records"| node_historyfile
node_student -->|"gets timestamp"| node_date
node_student -->|"parses records"| node_strings
node_find -->|"reads search input"| node_validate
node_find -->|"loads records"| node_student
node_historyview -->|"loads records"| node_student
node_student -->|"reads records"| node_historyfile
node_find -->|"matches names"| node_strings
node_historyview -->|"renders records"| node_student

click node_menu "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsMainMenuUI.h"
click node_gpa "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcGPAScreen.h"
click node_cgpa "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcCGPAScreen.h"
click node_find "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsFindStudentResults.h"
click node_historyview "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsShowAllHistoryScreen.h"
click node_student "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsStudent.h"
click node_course "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCourse.h"
click node_validate "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsInputValidate.h"
click node_strings "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsString.h"
click node_date "https://github.com/baraaelgendy/gpa-calculator/blob/master/clsDate.h"
click node_historyfile "https://github.com/baraaelgendy/gpa-calculator/blob/master/History.txt"
click node_program "https://github.com/baraaelgendy/gpa-calculator/blob/master/GPA%20Calculator.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_menu,node_gpa,node_cgpa,node_find,node_historyview,node_program,node_user toneBlue
class node_student,node_course toneAmber
class node_historyfile toneMint
class node_validate,node_strings,node_date toneRose
```

## Components

### Console interface

- [Main menu](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsMainMenuUI.h): `clsMainMenuUI.h`
- [GPA screen](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcGPAScreen.h): `clsCalcGPAScreen.h`
- [CGPA screen](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCalcCGPAScreen.h): `clsCalcCGPAScreen.h`
- [Find results](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsFindStudentResults.h): `clsFindStudentResults.h`
- [History screen](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsShowAllHistoryScreen.h): `clsShowAllHistoryScreen.h`
- [Application entry](https://github.com/baraaelgendy/gpa-calculator/blob/master/GPA%20Calculator.cpp): `GPA Calculator.cpp`

### Calculation

- [Student model](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsStudent.h): `clsStudent.h`
- [Course grading](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsCourse.h): `clsCourse.h`

### Student records

- [Calculation history](https://github.com/baraaelgendy/gpa-calculator/blob/master/History.txt): `History.txt`

### Shared utilities

- [Input validation](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsInputValidate.h): `clsInputValidate.h`
- [String utilities](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsString.h): `clsString.h`
- [Date and time](https://github.com/baraaelgendy/gpa-calculator/blob/master/clsDate.h): `clsDate.h`

### Other components

- **Console user**

## Connections

- Console user → Application entry: starts
- Application entry → Main menu: opens
- Console user → Main menu: chooses
- Main menu → Input validation: validates choice
- Main menu → GPA screen: dispatches
- Main menu → CGPA screen: dispatches
- Main menu → Find results: dispatches
- Main menu → History screen: dispatches
- GPA screen → Input validation: validates input
- CGPA screen → Input validation: validates input
- GPA screen → Student model: creates and calculates
- CGPA screen → Student model: creates and calculates
- Student model → Course grading: adds courses
- GPA screen → Student model: saves result
- CGPA screen → Student model: saves result
- Student model → Calculation history: appends records
- Student model → Date and time: gets timestamp
- Student model → String utilities: parses records
- Find results → Input validation: reads search input
- Find results → Student model: loads records
- History screen → Student model: loads records
- Student model → Calculation history: reads records
- Find results → String utilities: matches names
- History screen → Student model: renders records
