JAVA-Daily-Tasks

πŸ“˜ Day 02 - Conditional Statements

This folder contains my Day 02 Java practice tasks focused on conditional statements and decision-making.

The goal of this day is to understand how Java makes decisions based on different conditions and apply those concepts to simple programming and real-world problems.


πŸ“š Topics Covered


πŸ“ Folder Structure

Day-02-Conditional-Statements/
β”‚
β”œβ”€β”€ README.md
β”‚
β”œβ”€β”€ Questions/
β”‚   └── Questions.txt
β”‚
β”œβ”€β”€ Solutions/
β”‚   β”œβ”€β”€ Q01_Positive_or_Negative.java
β”‚   β”œβ”€β”€ Q02_Odd_or_Even.java
β”‚   β”œβ”€β”€ Q03_Largest_of_Two.java
β”‚   β”œβ”€β”€ Q04_Smallest_of_Two.java
β”‚   β”œβ”€β”€ Q05_Largest_of_Three.java
β”‚   β”œβ”€β”€ Q06_Leap_Year.java
β”‚   β”œβ”€β”€ Q07_Student_Grade.java
β”‚   β”œβ”€β”€ Q08_Electricity_Bill.java
β”‚   β”œβ”€β”€ Q09_Discount_Calculation.java
β”‚   └── Q10_Loan_Eligibility.java
β”‚
└── Screenshots/
    β”œβ”€β”€ Output_1.png
    β”œβ”€β”€ Output_2.png
    β”œβ”€β”€ Output_3.png
    β”œβ”€β”€ Output_4.png
    β”œβ”€β”€ Output_5.png
    β”œβ”€β”€ Output_6.png
    β”œβ”€β”€ Output_7.png
    β”œβ”€β”€ Output_8.png
    β”œβ”€β”€ Output_9.png
    └── Output_10.png

πŸ“ Practice Questions

No. Problem Main Concept
Q01 Positive or Negative if-else
Q02 Odd or Even Modulus %
Q03 Largest of Two Numbers if-else
Q04 Smallest of Two Numbers if-else
Q05 Largest of Three Numbers else-if
Q06 Leap Year Conditions + %
Q07 Student Grade else-if
Q08 Electricity Bill Real-world conditions
Q09 Discount Calculation Conditions + percentage
Q10 Loan Eligibility Logical &&

πŸ’» Solutions

Q01 - Positive or Negative

Checks whether a given number is positive, negative, or zero.

Concepts used:


Q02 - Odd or Even

Checks whether a number is odd or even using the modulus operator.

Concepts used:


Q03 - Largest of Two Numbers

Finds the largest value between two numbers.

Concepts used:


Q04 - Smallest of Two Numbers

Finds the smallest value between two numbers.

Concepts used:


Q05 - Largest of Three Numbers

Finds the largest value among three numbers.

Concepts used:


Q06 - Leap Year

Checks whether a given year is a leap year.

Concepts used:


Q07 - Student Grade

Calculates a student’s grade based on their marks.

Concepts used:


Q08 - Electricity Bill

Calculates an electricity bill based on the number of units consumed and adds a surcharge.

Concepts used:


Q09 - Discount Calculation

Calculates the discount amount and final purchase amount based on the purchase value.

Concepts used:


Q10 - Loan Eligibility

Checks whether a person is eligible for a loan based on their age and monthly salary.

Concepts used:


πŸ–₯️ Output Screenshots

Q01 - Positive or Negative

Q01 Output


Q02 - Odd or Even

Q02 Output


Q03 - Largest of Two Numbers

Q03 Output


Q04 - Smallest of Two Numbers

Q04 Output


Q05 - Largest of Three Numbers

Q05 Output


Q06 - Leap Year

Q06 Output


Q07 - Student Grade

Q07 Output


Q08 - Electricity Bill

Q08 Output


Q09 - Discount Calculation

Q09 Output


Q10 - Loan Eligibility

Q10 Output


πŸ› οΈ Technologies Used


▢️ How to Run

Step 1 - Open the Solutions Folder

Open the terminal inside the Solutions folder.

cd Solutions

Step 2 - Compile a Java Program

For example:

javac Q01_Positive_or_Negative.java

Step 3 - Run the Program

java Q01_Positive_or_Negative

You can follow the same process for the remaining programs.


▢️ Compile All Programs

To compile all Java files inside the Solutions folder:

javac *.java

Then run any program individually:

java Q01_Positive_or_Negative
java Q02_Odd_or_Even
java Q03_Largest_of_Two

πŸ“Έ Screenshots

The Screenshots folder contains the output screenshots for all 10 Java programs.

Each screenshot is linked to its corresponding practice question above to make it easy to understand the program execution and output.


🧠 What I Learned

Through Day 02, I practiced:


🎯 Learning Goal

The main goal of Day 02 is to build a strong foundation in conditional statements and decision-making in Java.

These concepts are important for solving programming problems and will be used in upcoming Java topics.


πŸ“ˆ Progress

Day Topic Status
Day 02 Conditional Statements βœ… Completed

Learning Java step by step by practicing small problems every day.


πŸ‘¨β€πŸ’» Author

M. Praveen Kumar


⭐ This folder is part of my Java Daily Tasks journey to improve my Java programming and problem-solving skills.