Skip to content

Commit d801ebc

Browse files
Update README.md
1 parent 960c133 commit d801ebc

File tree

1 file changed

+69
-76
lines changed

1 file changed

+69
-76
lines changed

README.md

Lines changed: 69 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,104 +1,97 @@
1-
# 📘 Java Basics: Control Flow
1+
# Java OOP Fundamentals
22

3-
![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)
3+
![Java Build](https://github.com/TheComputationalCore/java-oop-fundamentals/actions/workflows/java-build.yml/badge.svg)
44

5-
6-
This repository contains a collection of beginner-friendly Java programs focused on **control flow**, including looping, conditional statements, number operations, and pattern generation. Each file is a standalone logic exercise designed to build foundational programming skills.
7-
8-
## 📌 Overview
9-
10-
This project includes simple yet foundational Java programs that cover:
11-
12-
- Printing numeric ranges
13-
- Checking number signs
14-
- Reversing integers
15-
- Comparing numbers
16-
- Applying conditional logic (discount calculation)
17-
- Generating patterns with nested loops
18-
19-
All source files are located inside:
20-
21-
```
22-
/task1
23-
```
5+
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.
246

257
## 📁 Project Structure
26-
278
```
28-
java-basics-control-flow/
29-
├── task1/
30-
│ ├── CheckNumberSign.java
31-
│ ├── DiscountCalculator.java
32-
│ ├── FindSmallestOfThree.java
33-
│ ├── NumberPatternGenerator.java
34-
│ ├── NumberPatternGeneratorAlt.java
35-
│ ├── PrintNumRange.java
36-
│ ├── ReverseNumber.java
37-
│────── Problems.md
38-
├── screenshots/
39-
│ ├── discountcal.png
40-
│ ├── numcheck.png
41-
│ ├── pattern.png
42-
│ ├── printnumrange.png
43-
│ ├── reversenum.png
44-
│ └── smallnum.png
45-
└── README.md
9+
src/
10+
├── Account.java
11+
├── Person.java
12+
├── Person_2.java
13+
├── Product.java
14+
├── XYZ.java
15+
└── screenshots/
16+
├── 1.1.png
17+
├── 1.2.a.png
18+
├── 1.2.b.png
19+
├── 1.3.png
20+
└── 1.4.png
4621
```
4722

48-
## 🖼️ Program Output Screenshots
23+
## 📝 Task Overviews
4924

50-
### 1️⃣ Print Number Range
51-
![Print Number Range](screenshots/printnumrange.png)
25+
### **Task 1.1 — Person Class**
26+
- Implements a `Person` class with `name` and `age`.
27+
- Default age is **18**.
28+
- Includes constructor + method to display info.
5229

53-
### 2️⃣ Check Number Sign
54-
![Check Number Sign](screenshots/numcheck.png)
30+
▶️ **Screenshot:**
31+
![1.1](screenshots/1.1.png)
5532

56-
### 3️⃣ Reverse Number
57-
![Reverse Number](screenshots/reversenum.png)
33+
---
5834

59-
### 4️⃣ Find Smallest of Three
60-
![Smallest Number](screenshots/smallnum.png)
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**.
6141

62-
### 5️⃣ Discount Calculator
63-
![Discount](screenshots/discountcal.png)
42+
▶️ **Screenshots:**
43+
![1.2a](screenshots/1.2.a.png)
44+
![1.2b](screenshots/1.2.b.png)
6445

65-
### 6️⃣ Number Pattern
66-
![Pattern](screenshots/pattern.png)
46+
---
6747

68-
## ▶️ Running the Programs
48+
### **Task 1.3 — Account Class**
49+
- Implements `deposit`, `withdraw`, and `display` methods.
50+
- Includes default + parameterized constructors.
6951

70-
1. Navigate to the directory:
52+
▶️ **Screenshot:**
53+
![1.3](screenshots/1.3.png)
7154

72-
```
73-
cd task1
74-
```
55+
---
7556

76-
2. Compile the program:
57+
### **Task 1.4 — Inheritance (Person → Employee)**
58+
- `Employee` extends `Person`.
59+
- Adds `employeeID` and `salary`.
60+
- Uses `super()` for parent initialization.
7761

78-
```
79-
javac FileName.java
80-
```
62+
▶️ **Screenshot:**
63+
![1.4](screenshots/1.4.png)
8164

82-
3. Run the program:
65+
---
8366

84-
```
85-
java FileName
86-
```
67+
## ▶️ Running the Programs
8768

88-
Example:
69+
### **1. Clone the Repository**
70+
```bash
71+
git clone https://github.com/TheComputationalCore/java-oop-fundamentals.git
72+
cd java-oop-fundamentals/src
73+
```
8974

75+
### **2. Compile**
76+
```bash
77+
javac *.java
9078
```
91-
javac PrintNumRange.java
92-
java PrintNumRange
79+
80+
### **3. Run (examples)**
81+
```bash
82+
java Person
83+
java Product
84+
java Account
85+
java XYZ
9386
```
9487

95-
## 🧰 Requirements
88+
---
9689

97-
- JDK 8 or above
98-
- Any IDE or terminal capable of running Java
90+
## 📦 Requirements
91+
- Java JDK **8 or higher**
92+
- Any terminal or Java IDE
9993

100-
## 🙋 Contact
94+
---
10195

102-
**Dinesh Chandra — TheComputationalCore**
103-
GitHub: https://github.com/TheComputationalCore
104-
YouTube: https://www.youtube.com/@TheComputationalCore
96+
## 📄 License
97+
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)