Skip to content

Commit fb6a4b1

Browse files
Update README.md
1 parent 8747873 commit fb6a4b1

File tree

1 file changed

+48
-70
lines changed

1 file changed

+48
-70
lines changed

README.md

Lines changed: 48 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,25 @@
1-
# Java Basics: Control Flow
1+
# Java Basics: Control Flow
22

3-
This repository contains a collection of beginnerfriendly Java programs focused on **control flow**, including branching and looping constructs. Each program is selfcontained and demonstrates a specific logic-building exercise.
3+
This repository contains a collection of beginner-friendly Java programs focused on **control flow**, including branching and looping constructs. Each program is self-contained and demonstrates a specific logic-building exercise.
44

55
---
66

7-
## 📌 Overview
7+
## 🚀 Overview
88

99
This project includes simple yet foundational Java programs that cover:
1010

1111
- Printing number ranges
12-
- Determining number signs
13-
- Reversing numbers
12+
- Checking if a number is positive or negative
13+
- Reversing a number
1414
- Finding the smallest of three numbers
1515
- Calculating discounts
16-
- Printing numeric patterns
16+
- Generating number patterns
1717

18-
These exercises form the basis for mastering Java control flow and problem‑solving fundamentals.
18+
Each program is placed inside the `task1` folder and is beginner‑friendly.
1919

2020
---
2121

22-
## 🛠 Prerequisites
23-
24-
Ensure you have:
25-
26-
- **Java Development Kit (JDK)** — version 8 or later
27-
- A Java‑compatible editor (IntelliJ IDEA, VS Code, Eclipse, etc.)
28-
29-
---
30-
31-
## 🚀 How to Run the Programs
32-
33-
1. **Clone the repository**
34-
35-
```bash
36-
git clone https://github.com/TheComputationalCore/java-basics-control-flow-task1.git
37-
cd java-basics-control-flow-task1/task1
38-
```
39-
40-
2. **Compile any program**
41-
42-
```bash
43-
javac FileName.java
44-
```
45-
46-
3. **Run the program**
47-
48-
```bash
49-
java FileName
50-
```
51-
52-
Replace `FileName` with the program you want to execute.
53-
54-
---
55-
56-
## 📁 Project Structure
22+
## 📂 Project Structure
5723

5824
```
5925
task1/
@@ -64,50 +30,62 @@ task1/
6430
├── NumberPatternGeneratorAlt.java
6531
├── PrintNumRange.java
6632
├── ReverseNumber.java
67-
──Problems.md
68-
──README.md
33+
├── Problems.md
34+
└── README.md
6935
```
7036

7137
---
7238

73-
## 📚 Program Descriptions
39+
## 🖼️ Program Output Screenshots
40+
41+
### 1️⃣ Print Number Range
42+
![PrintNumRange](printnumrange.png)
7443

75-
### 🔹 PrintNumRange.java
76-
Prints numbers from **10 to 50** using a loop.
44+
### 2️⃣ Check Number Sign
45+
![Check Number Sign](numcheck.png)
7746

78-
### 🔹 CheckNumberSign.java
79-
Checks if a number is **positive** or **negative**.
47+
### 3️⃣ Reverse Number
48+
![Reverse Number](reversenum.png)
8049

81-
### 🔹 ReverseNumber.java
82-
Reverses the digits of a number (e.g., 876 → 678).
50+
### 4️⃣ Find Smallest of Three
51+
![Smallest Number](smallnum.png)
8352

84-
### 🔹 FindSmallestOfThree.java
85-
Determines the **smallest** among three numbers.
53+
### 5️⃣ Discount Calculator
54+
![Discount](discountcal.png)
8655

87-
### 🔹 DiscountCalculator.java
88-
Calculates discounted price based on purchase amount.
56+
### 6️⃣ Number Pattern
57+
![Pattern](pattern.png)
8958

90-
**Discount Rules:**
91-
- `< 500` — No discount
92-
- `500–1000` — 10% discount
93-
- `> 1000` — 20% discount
59+
---
9460

95-
### 🔹 NumberPatternGenerator.java
96-
Prints a numeric pattern using nested loops.
61+
## ▶️ Running the Programs
9762

98-
### 🔹 NumberPatternGeneratorAlt.java
99-
Alternate implementation of the same pattern.
63+
### **Prerequisites**
64+
- Java Development Kit (JDK) 8 or higher
65+
- Any IDE or terminal to execute Java files
66+
67+
### **Compile**
68+
```bash
69+
javac Filename.java
70+
```
71+
72+
### **Run**
73+
```bash
74+
java Filename
75+
```
76+
77+
Each program prompts the user for input where necessary and displays results accordingly.
10078

10179
---
10280

103-
## 🎯 Usage Notes
81+
## 📘 Problems Reference
10482

105-
- Each program runs independently.
106-
- Inputs may be hardcoded or prompted in the console.
107-
- Review each file for specific behavior.
83+
All problem statements are listed in the `Problems.md` file inside the repository.
10884

10985
---
11086

111-
Created by **Dinesh Chandra — TheComputationalCore**
112-
GitHub: https://github.com/TheComputationalCore
113-
YouTube: https://www.youtube.com/@TheComputationalCore
87+
## 📩 Contact
88+
89+
**Dinesh Chandra — TheComputationalCore**
90+
🔗 GitHub: https://github.com/TheComputationalCore
91+
🔗 YouTube: https://www.youtube.com/@TheComputationalCore

0 commit comments

Comments
 (0)