|
1 | | -# Java Basics: Control Flow |
| 1 | +# 📘 Java Basics: Control Flow |
2 | 2 |
|
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. |
| 3 | +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. |
4 | 4 |
|
5 | | ---- |
6 | | - |
7 | | -## 🚀 Overview |
| 5 | +## 📌 Overview |
8 | 6 |
|
9 | 7 | This project includes simple yet foundational Java programs that cover: |
10 | 8 |
|
11 | | -- Printing number ranges |
12 | | -- Checking if a number is positive or negative |
13 | | -- Reversing a number |
14 | | -- Finding the smallest of three numbers |
15 | | -- Calculating discounts |
16 | | -- Generating number patterns |
| 9 | +- Printing numeric ranges |
| 10 | +- Checking number signs |
| 11 | +- Reversing integers |
| 12 | +- Comparing numbers |
| 13 | +- Applying conditional logic (discount calculation) |
| 14 | +- Generating patterns with nested loops |
17 | 15 |
|
18 | | -Each program is placed inside the `task1` folder and is beginner‑friendly. |
| 16 | +All source files are located inside: |
19 | 17 |
|
20 | | ---- |
| 18 | +``` |
| 19 | +/task1 |
| 20 | +``` |
21 | 21 |
|
22 | | -## 📂 Project Structure |
| 22 | +## 📁 Project Structure |
23 | 23 |
|
24 | 24 | ``` |
25 | | -task1/ |
26 | | -├── CheckNumberSign.java |
27 | | -├── DiscountCalculator.java |
28 | | -├── FindSmallestOfThree.java |
29 | | -├── NumberPatternGenerator.java |
30 | | -├── NumberPatternGeneratorAlt.java |
31 | | -├── PrintNumRange.java |
32 | | -├── ReverseNumber.java |
33 | | -├── Problems.md |
| 25 | +java-basics-control-flow/ |
| 26 | +├── task1/ |
| 27 | +│ ├── CheckNumberSign.java |
| 28 | +│ ├── DiscountCalculator.java |
| 29 | +│ ├── FindSmallestOfThree.java |
| 30 | +│ ├── NumberPatternGenerator.java |
| 31 | +│ ├── NumberPatternGeneratorAlt.java |
| 32 | +│ ├── PrintNumRange.java |
| 33 | +│ ├── ReverseNumber.java |
| 34 | +│────── Problems.md |
| 35 | +├── screenshots/ |
| 36 | +│ ├── discountcal.png |
| 37 | +│ ├── numcheck.png |
| 38 | +│ ├── pattern.png |
| 39 | +│ ├── printnumrange.png |
| 40 | +│ ├── reversenum.png |
| 41 | +│ └── smallnum.png |
34 | 42 | └── README.md |
35 | 43 | ``` |
36 | 44 |
|
37 | | ---- |
38 | | - |
39 | 45 | ## 🖼️ Program Output Screenshots |
40 | 46 |
|
41 | 47 | ### 1️⃣ Print Number Range |
42 | | - |
| 48 | + |
43 | 49 |
|
44 | 50 | ### 2️⃣ Check Number Sign |
45 | | - |
| 51 | + |
46 | 52 |
|
47 | 53 | ### 3️⃣ Reverse Number |
48 | | - |
| 54 | + |
49 | 55 |
|
50 | 56 | ### 4️⃣ Find Smallest of Three |
51 | | - |
| 57 | + |
52 | 58 |
|
53 | 59 | ### 5️⃣ Discount Calculator |
54 | | - |
| 60 | + |
55 | 61 |
|
56 | 62 | ### 6️⃣ Number Pattern |
57 | | - |
58 | | - |
59 | | ---- |
| 63 | + |
60 | 64 |
|
61 | 65 | ## ▶️ Running the Programs |
62 | 66 |
|
63 | | -### **Prerequisites** |
64 | | -- Java Development Kit (JDK) 8 or higher |
65 | | -- Any IDE or terminal to execute Java files |
| 67 | +1. Navigate to the directory: |
66 | 68 |
|
67 | | -### **Compile** |
68 | | -```bash |
69 | | -javac Filename.java |
70 | 69 | ``` |
| 70 | +cd task1 |
| 71 | +``` |
| 72 | + |
| 73 | +2. Compile the program: |
71 | 74 |
|
72 | | -### **Run** |
73 | | -```bash |
74 | | -java Filename |
75 | 75 | ``` |
| 76 | +javac FileName.java |
| 77 | +``` |
| 78 | + |
| 79 | +3. Run the program: |
76 | 80 |
|
77 | | -Each program prompts the user for input where necessary and displays results accordingly. |
| 81 | +``` |
| 82 | +java FileName |
| 83 | +``` |
78 | 84 |
|
79 | | ---- |
| 85 | +Example: |
80 | 86 |
|
81 | | -## 📘 Problems Reference |
| 87 | +``` |
| 88 | +javac PrintNumRange.java |
| 89 | +java PrintNumRange |
| 90 | +``` |
82 | 91 |
|
83 | | -All problem statements are listed in the `Problems.md` file inside the repository. |
| 92 | +## 🧰 Requirements |
84 | 93 |
|
85 | | ---- |
| 94 | +- JDK 8 or above |
| 95 | +- Any IDE or terminal capable of running Java |
86 | 96 |
|
87 | | -## 📩 Contact |
| 97 | +## 🙋 Contact |
88 | 98 |
|
89 | 99 | **Dinesh Chandra — TheComputationalCore** |
90 | | -🔗 GitHub: https://github.com/TheComputationalCore |
91 | | -🔗 YouTube: https://www.youtube.com/@TheComputationalCore |
| 100 | +GitHub: https://github.com/TheComputationalCore |
| 101 | +YouTube: https://www.youtube.com/@TheComputationalCore |
0 commit comments