Skip to content

Commit 30422fd

Browse files
Update README.md
1 parent b53dc1a commit 30422fd

File tree

1 file changed

+108
-100
lines changed

1 file changed

+108
-100
lines changed

README.md

Lines changed: 108 additions & 100 deletions
Original file line numberDiff line numberDiff line change
@@ -1,162 +1,170 @@
11
# Java Advanced: Exception Handling & Collections
22

3-
![Build Status](https://github.com/TheComputationalCore/java-advanced-exceptions-collections/actions/workflows/java-build.yml/badge.svg)
3+
<div align="center">
4+
5+
![Build Status](https://img.shields.io/badge/build-passing-brightgreen)
46
![License](https://img.shields.io/badge/License-MIT-yellow.svg)
57
![Java](https://img.shields.io/badge/Java-100%25-orange)
68
![Repo Size](https://img.shields.io/github/repo-size/TheComputationalCore/java-advanced-exceptions-collections)
79

10+
</div>
11+
812
---
913

10-
## 📚 Overview
14+
## 📌 Overview
1115

12-
This repository showcases **advanced Java concepts**, focusing on:
16+
This repository contains **advanced Java programs** demonstrating:
1317

14-
- Custom exception handling
15-
- Collections framework usage
16-
- Stack implementation
17-
- HashMaps
18-
- Array exception management
18+
- Custom Exception Handling
19+
- Collections Framework
20+
- Input Validation
21+
- Stack Implementation
22+
- HashMap Operations
1923

20-
It contains **five structured tasks (Q1–Q5)**, each reinforced with code screenshots laid out in elegant grids.
24+
It includes **five structured tasks (Q1–Q5)** supported by screenshots and organized code.
2125

2226
---
2327

24-
## 🛠️ Tech Stack
28+
## 🗂️ Project Structure
2529

26-
| Language | Paradigm | Topics |
27-
|---------|----------|--------|
28-
| **Java 8+** | OOP, Exception Handling | Collections, Custom Exceptions, Stack, HashMap |
30+
| File | Description |
31+
|------|-------------|
32+
| `Student.java` | Student class with age + name validation using custom exceptions (Q1) |
33+
| `AgeNotWithinRangeException.java` | Thrown when age is outside 15–21 (Q1) |
34+
| `NameNotValidException.java` | Thrown when name contains invalid characters (Q1) |
35+
| `Voter.java` | Validates voter age (must be ≥ 18) (Q2) |
36+
| `QuestionThree.java` | Weekday array with index validation (Q3) |
37+
| `QuestionFour.java` | Student grades using HashMap (Q4) |
38+
| `QuestionFive.java` | Stack implementation using Collections (Q5) |
39+
| `screenshots/` | Complete screenshots of implementations |
2940

3041
---
3142

32-
## 📁 Project Structure
43+
## 🖼️ Screenshots (Grid View)
3344

34-
```
35-
src/
36-
├── AgeNotWithinRangeException.java
37-
├── NameNotValidException.java
38-
├── Student.java
39-
├── Voter.java
40-
├── QuestionThree.java
41-
├── QuestionFour.java
42-
├── QuestionFive.java
43-
└── screenshots/
44-
├── 1.a.png
45-
├── 1.b.png
46-
├── 1.c.png
47-
├── 1.d.png
48-
├── 2.a.png
49-
├── 2.b.png
50-
├── 3.a.png
51-
├── 3.b.png
52-
├── 3.c.png
53-
├── 4.a.png
54-
├── 4.b.png
55-
├── 4.c.png
56-
├── 4.d.png
57-
└── 5.png
58-
```
45+
### **Q1 — Student Management (Exceptions)**
46+
<table>
47+
<tr>
48+
<td><img src="screenshots/1.a.png" width="250"></td>
49+
<td><img src="screenshots/1.b.png" width="250"></td>
50+
</tr>
51+
<tr>
52+
<td><img src="screenshots/1.c.png" width="250"></td>
53+
<td><img src="screenshots/1.d.png" width="250"></td>
54+
</tr>
55+
</table>
5956

6057
---
6158

62-
# 📝 Tasks Overview
59+
### **Q2 — Voter Age Validation**
60+
<table>
61+
<tr>
62+
<td><img src="screenshots/2.a.png" width="250"></td>
63+
<td><img src="screenshots/2.b.png" width="250"></td>
64+
</tr>
65+
</table>
6366

6467
---
6568

66-
# **Q1 — Student Management System (Custom Exceptions)**
69+
### **Q3 — Weekday Array Handling**
70+
<table>
71+
<tr>
72+
<td><img src="screenshots/3.a.png" width="250"></td>
73+
<td><img src="screenshots/3.b.png" width="250"></td>
74+
<td><img src="screenshots/3.c.png" width="250"></td>
75+
</tr>
76+
</table>
6777

68-
### ✔ Validates:
69-
- Age range (15–21)
70-
- Name characters (no digits/symbols)
78+
---
7179

72-
### ✔ Custom Exceptions:
73-
- `AgeNotWithinRangeException`
74-
- `NameNotValidException`
80+
### **Q4 — Student Grades (HashMap)**
81+
<table>
82+
<tr>
83+
<td><img src="screenshots/4.a.png" width="250"></td>
84+
<td><img src="screenshots/4.b.png" width="250"></td>
85+
</tr>
86+
<tr>
87+
<td><img src="screenshots/4.c.png" width="250"></td>
88+
<td><img src="screenshots/4.d.png" width="250"></td>
89+
</tr>
90+
</table>
7591

76-
### 📸 Screenshots
77-
| 1.a | 1.b |
78-
|---|---|
79-
| ![](screenshots/1.a.png) | ![](screenshots/1.b.png) |
92+
---
8093

81-
| 1.c | 1.d |
82-
|---|---|
83-
| ![](screenshots/1.c.png) | ![](screenshots/1.d.png) |
94+
### **Q5 — Stack Implementation**
95+
<img src="screenshots/5.png" width="300">
8496

8597
---
8698

87-
# **Q2 — Voter Age Validation**
88-
89-
Throws exception if voter age < 18.
99+
## 🧠 Task Breakdown
90100

91-
### 📸 Screenshots
92-
| 2.a | 2.b |
93-
|---|---|
94-
| ![](screenshots/2.a.png) | ![](screenshots/2.b.png) |
101+
### **Q1 — Custom Exceptions in Student Class**
102+
- Validates:
103+
- Age between **15–21**
104+
- Name must NOT contain digits or symbols
105+
- Uses two custom exceptions:
106+
- `AgeNotWithinRangeException`
107+
- `NameNotValidException`
95108

96109
---
97110

98-
# **Q3 — Weekday Array Handling**
111+
### **Q2 — Voter Age Validation**
112+
Ensures voter age is **≥ 18**, otherwise throws a custom exception.
99113

100-
Handles `ArrayIndexOutOfBoundsException` for invalid day index.
101-
102-
### 📸 Screenshots
103-
| 3.a | 3.b |
104-
|---|---|
105-
| ![](screenshots/3.a.png) | ![](screenshots/3.b.png) |
114+
---
106115

107-
| 3.c ||
108-
|---|---|
109-
| ![](screenshots/3.c.png) | |
116+
### **Q3 — Weekday Array**
117+
- Stores weekday names in an array.
118+
- Handles:
119+
- Invalid index
120+
- `ArrayIndexOutOfBoundsException`
110121

111122
---
112123

113-
# **Q4 — Student Grades with HashMap**
114-
115-
Enables:
124+
### **Q4 — Student Grades (HashMap)**
125+
Operations:
116126
- Add student + grade
117127
- Remove student
118-
- Display grade by name
119-
120-
### 📸 Screenshots
121-
| 4.a | 4.b |
122-
|---|---|
123-
| ![](screenshots/4.a.png) | ![](screenshots/4.b.png) |
128+
- Print grade by name
124129

125-
| 4.c | 4.d |
126-
|---|---|
127-
| ![](screenshots/4.c.png) | ![](screenshots/4.d.png) |
130+
Uses:
131+
```java
132+
HashMap<String, Integer>
133+
```
128134

129135
---
130136

131-
# **Q5 — Stack Implementation (Collections)**
132-
133-
Implements push, pop, isEmpty using Java Collections.
137+
### **Q5 — Integer Stack (Collections)**
138+
Implements:
139+
- `push()`
140+
- `pop()`
141+
- `isEmpty()`
134142

135-
### 📸 Screenshot
136-
| 5 |
137-
|---|
138-
| ![](screenshots/5.png) |
143+
Uses:
144+
```java
145+
Stack<Integer>
146+
```
139147

140148
---
141149

142-
# ▶️ How to Run
150+
## ▶️ How to Run
143151

144152
```bash
145153
git clone https://github.com/TheComputationalCore/java-advanced-exceptions-collections.git
146154
cd java-advanced-exceptions-collections
147155
javac *.java
148-
java Student # Q1
149-
java Voter # Q2
150-
java QuestionThree # Q3
151-
java QuestionFour # Q4
152-
java QuestionFive # Q5
156+
157+
# Run tasks:
158+
java Student # Q1
159+
java Voter # Q2
160+
java QuestionThree # Q3
161+
java QuestionFour # Q4
162+
java QuestionFive # Q5
153163
```
154164

155165
---
156166

157-
# 📄 License
167+
## 📄 License
158168

159-
Distributed under the MIT License.
160-
161-
---
169+
This project is licensed under the **MIT License**.
162170

0 commit comments

Comments
 (0)