# mohammednahas/programming_3 architecture

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

- Interactive diagram: https://gitdiagram.com/mohammednahas/programming_3
- Repository: https://github.com/mohammednahas/programming_3

## Overview

This repository is a set of Java learning examples, not one integrated application. Week 1 demonstrates bank-account balance operations and exception handling; Week 2 demonstrates binary copying, text I/O, random access, and student-object serialization. The graph keeps these independent exercises separate. Relationships are shown only where excerpts or the source index support them; several Week 2 examples have no evidenced connections to one another.

Main entry points: [`Week2/src/com/company/SaveStudent.java`](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/SaveStudent.java) (Save student), [`Week2/src/com/company/ReadStudent.java`](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/ReadStudent.java) (Read student), [`Week1_exceptions/src/com/company/Main.java`](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/Main.java) (Bank demo), [`Week1_exceptions/src/com/company/BankAccount3.java`](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount3.java) (Checked account)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_exceptions["Bank Exceptions"]
  node_week1main["Bank demo<br/>[Main.java]"]
  node_basicaccount["Basic account<br/>[BankAccount.java]"]
  node_runtimeaccount["Runtime account<br/>[BankAccount2.java]"]
  node_checkedaccount["Checked account<br/>[BankAccount3.java]"]
  node_balanceexception["Balance exception"]
end

subgraph group_io["File I/O"]
  node_week2main["Empty entry point<br/>[Main.java]"]
  node_bytecopy["Byte copy"]
  node_bufferedcopy["Buffered copy"]
  node_streamcopy["Buffered streams"]
  node_randomaccess["Random access<br/>[RandomAccess.java]"]
  node_textread["Text reader"]
  node_textwrite["Text writer"]
  node_save_student["Save student<br/>[SaveStudent.java]"]
  node_read_student["Read student<br/>[ReadStudent.java]"]
  node_student["Student model<br/>[Student.java]"]
  node_studentfile["Serialized data<br/>[student.dat]"]
end

node_runner(("Example runner"))
node_imagefiles["Image files"]

node_runner -->|"runs"| node_week1main
node_week1main -->|"creates and exercises"| node_checkedaccount
node_checkedaccount -->|"throws"| node_balanceexception
node_runner -->|"runs"| node_bytecopy
node_runner -->|"runs"| node_bufferedcopy
node_runner -->|"runs"| node_streamcopy
node_bytecopy -->|"reads and writes"| node_imagefiles
node_bufferedcopy -->|"reads and writes"| node_imagefiles
node_streamcopy -->|"reads and writes"| node_imagefiles
node_runner -->|"runs"| node_save_student
node_runner -->|"runs"| node_read_student
node_save_student -->|"creates and serializes"| node_student
node_read_student -->|"reads as"| node_student
node_save_student -->|"writes"| node_studentfile
node_read_student -->|"reads"| node_studentfile

click node_week1main "https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/Main.java"
click node_basicaccount "https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount.java"
click node_runtimeaccount "https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount2.java"
click node_checkedaccount "https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount3.java"
click node_balanceexception "https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/InsufficientBalanceException.java"
click node_week2main "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/Main.java"
click node_bytecopy "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyExample.java"
click node_bufferedcopy "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyExampleWithBuffer.java"
click node_streamcopy "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyUsingBufferStream.java"
click node_randomaccess "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/RandomAccess.java"
click node_textread "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/TextReadExample.java"
click node_textwrite "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/TextWriteExample.java"
click node_save_student "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/SaveStudent.java"
click node_read_student "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/ReadStudent.java"
click node_student "https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/Student.java"
click node_studentfile "https://github.com/mohammednahas/programming_3/blob/main/Week2/student.dat"

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_week1main,node_basicaccount,node_runtimeaccount,node_checkedaccount,node_balanceexception toneBlue
class node_week2main,node_bytecopy,node_bufferedcopy,node_streamcopy,node_randomaccess,node_textread,node_textwrite,node_save_student,node_read_student,node_student,node_studentfile toneAmber
class node_runner,node_imagefiles toneIndigo
```

## Components

### Bank Exceptions

- [Bank demo](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/Main.java): `Week1_exceptions/src/com/company/Main.java`
- [Basic account](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount.java): `Week1_exceptions/src/com/company/BankAccount.java`
- [Runtime account](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount2.java): `Week1_exceptions/src/com/company/BankAccount2.java`
- [Checked account](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/BankAccount3.java): `Week1_exceptions/src/com/company/BankAccount3.java`
- [Balance exception](https://github.com/mohammednahas/programming_3/blob/main/Week1_exceptions/src/com/company/InsufficientBalanceException.java): `Week1_exceptions/src/com/company/InsufficientBalanceException.java`

### File I/O

- [Empty entry point](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/Main.java): `Week2/src/com/company/Main.java`
- [Byte copy](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyExample.java): `Week2/src/com/company/BinaryCopyExample.java`
- [Buffered copy](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyExampleWithBuffer.java): `Week2/src/com/company/BinaryCopyExampleWithBuffer.java`
- [Buffered streams](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/BinaryCopyUsingBufferStream.java): `Week2/src/com/company/BinaryCopyUsingBufferStream.java`
- [Random access](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/RandomAccess.java): `Week2/src/com/company/RandomAccess.java`
- [Text reader](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/TextReadExample.java): `Week2/src/com/company/TextReadExample.java`
- [Text writer](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/TextWriteExample.java): `Week2/src/com/company/TextWriteExample.java`
- [Save student](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/SaveStudent.java): `Week2/src/com/company/SaveStudent.java`
- [Read student](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/ReadStudent.java): `Week2/src/com/company/ReadStudent.java`
- [Student model](https://github.com/mohammednahas/programming_3/blob/main/Week2/src/com/company/Student.java): `Week2/src/com/company/Student.java`
- [Serialized data](https://github.com/mohammednahas/programming_3/blob/main/Week2/student.dat): `Week2/student.dat`

### Other components

- **Example runner**
- **Image files**

## Connections

- Example runner → Bank demo: runs (evidence: `Week1_exceptions/src/com/company/Main.java`)
- Bank demo → Checked account: creates and exercises (evidence: `Week1_exceptions/src/com/company/Main.java`)
- Checked account → Balance exception: throws (evidence: `Week1_exceptions/src/com/company/BankAccount3.java`)
- Example runner → Byte copy: runs (evidence: `Week2/src/com/company/BinaryCopyExample.java`)
- Example runner → Buffered copy: runs (evidence: `Week2/src/com/company/BinaryCopyExampleWithBuffer.java`)
- Example runner → Buffered streams: runs (evidence: `Week2/src/com/company/BinaryCopyUsingBufferStream.java`)
- Byte copy → Image files: reads and writes (evidence: `Week2/src/com/company/BinaryCopyExample.java`)
- Buffered copy → Image files: reads and writes (evidence: `Week2/src/com/company/BinaryCopyExampleWithBuffer.java`)
- Buffered streams → Image files: reads and writes (evidence: `Week2/src/com/company/BinaryCopyUsingBufferStream.java`)
- Example runner → Save student: runs (evidence: `Week2/src/com/company/SaveStudent.java`)
- Example runner → Read student: runs (evidence: `Week2/src/com/company/ReadStudent.java`)
- Save student → Student model: creates and serializes (evidence: `Week2/src/com/company/SaveStudent.java`)
- Read student → Student model: reads as (evidence: `Week2/src/com/company/ReadStudent.java`)
- Save student → Serialized data: writes (evidence: `Week2/src/com/company/SaveStudent.java`)
- Read student → Serialized data: reads (evidence: `Week2/src/com/company/ReadStudent.java`)
