Skip to content

Commit 88109b9

Browse files
Update README.md
1 parent 2ca8404 commit 88109b9

File tree

1 file changed

+51
-55
lines changed

1 file changed

+51
-55
lines changed

README.md

Lines changed: 51 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,100 +2,96 @@
22

33
![Java Build](https://github.com/TheComputationalCore/java-oop-fundamentals/actions/workflows/java-build.yml/badge.svg)
44

5-
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
6-
7-
85
This repository contains Java programs demonstrating fundamental Object-Oriented Programming (OOP) concepts such as encapsulation, inheritance, and basic class design. It includes four tasks (1.1 to 1.4), each illustrating a different OOP principle.
96

10-
---
11-
127
## 📁 Project Structure
13-
148
```
159
src/
1610
├── Account.java
1711
├── Person.java
1812
├── Person_2.java
1913
├── Product.java
2014
├── XYZ.java
21-
├── screenshots/
22-
│ ├── 1.1.png
23-
│ ├── 1.2.a.png
24-
│ ├── 1.2.b.png
25-
│ ├── 1.3.png
26-
│ └── 1.4.png
27-
└── README.md
28-
└── LICENSE
15+
└── screenshots/
16+
├── 1.1.png
17+
├── 1.2.a.png
18+
├── 1.2.b.png
19+
├── 1.3.png
20+
└── 1.4.png
2921
```
3022

31-
---
32-
33-
## 📝 Tasks Overview
23+
## 📝 Task Overviews
3424

35-
### **Task 1.1 Person Class**
25+
### **Task 1.1 Person Class**
3626
- Implements a `Person` class with `name` and `age`.
37-
- Default age is set to **18**.
38-
- Uses constructors and a display method.
27+
- Default age is **18**.
28+
- Includes constructor + method to display info.
3929

40-
📸 **Screenshot:**
41-
![Task 1.1](screenshots/1.1.png)
30+
▶️ **Screenshot:**
31+
![1.1](screenshots/1.1.png)
4232

4333
---
4434

45-
### **Task 1.2 – Product Class**
46-
Defines a `Product` class and a main driver that:
47-
- Accepts details of **5 products**
48-
- Finds the product with the **highest price**
49-
- Computes **total amount spent** (price × quantity)
35+
### **Task 1.2 — Product Class**
36+
- Represents products with `pid`, `price`, and `quantity`.
37+
- `ProductMain`:
38+
- Accepts **5 products**.
39+
- Finds **highest price product**.
40+
- Calculates **total expenditure**.
5041

51-
📸 **Screenshots:**
52-
![1.2.a](screenshots/1.2.a.png)
53-
![1.2.b](screenshots/1.2.b.png)
42+
▶️ **Screenshots:**
43+
![1.2a](screenshots/1.2.a.png)
44+
![1.2b](screenshots/1.2.b.png)
5445

5546
---
5647

57-
### **Task 1.3 – Account Class**
58-
Implements:
59-
- Default & parameterized constructors
60-
- Deposit and withdraw methods
61-
- Balance display
48+
### **Task 1.3 — Account Class**
49+
- Implements `deposit`, `withdraw`, and `display` methods.
50+
- Includes default + parameterized constructors.
6251

63-
📸 **Screenshot:**
64-
![Task 1.3](screenshots/1.3.png)
52+
▶️ **Screenshot:**
53+
![1.3](screenshots/1.3.png)
6554

6655
---
6756

68-
### **Task 1.4 – Inheritance (Person → Employee)**
69-
Contains `XYZ.java`:
70-
- Base class: `Person`
71-
- Subclass: `Employee`
72-
- Demonstrates constructor chaining using `super`
57+
### **Task 1.4 — Inheritance (Person → Employee)**
58+
- `Employee` extends `Person`.
59+
- Adds `employeeID` and `salary`.
60+
- Uses `super()` for parent initialization.
7361

74-
📸 **Screenshot:**
75-
![Task 1.4](screenshots/1.4.png)
62+
▶️ **Screenshot:**
63+
![1.4](screenshots/1.4.png)
7664

7765
---
7866

79-
## ▶️ How to Run
67+
## ▶️ Running the Programs
8068

69+
### **1. Clone the Repository**
8170
```bash
82-
javac *.java
71+
git clone https://github.com/TheComputationalCore/java-oop-fundamentals.git
72+
cd java-oop-fundamentals/src
8373
```
8474

85-
Run a specific task:
75+
### **2. Compile**
76+
```bash
77+
javac *.java
78+
```
8679

87-
| Task | Command |
88-
|------|---------|
89-
| 1.1 | `java Person` |
90-
| 1.2 | `java Product` |
91-
| 1.3 | `java Account` |
92-
| 1.4 | `java XYZ` |
80+
### **3. Run (examples)**
81+
```bash
82+
java Person
83+
java Product
84+
java Account
85+
java XYZ
86+
```
9387

9488
---
9589

96-
## 🧩 Requirements
90+
## 📦 Requirements
9791
- Java JDK **8 or higher**
98-
- Any IDE or terminal
92+
- Any terminal or Java IDE
9993

10094
---
10195

96+
## 📄 License
97+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)