This repository contains various Java programs to solve common programming problems. Each program focuses on basic control structures, conditional statements, and mathematical computations.
This repository includes solutions for:
- Weekday identification based on week number
- Month days calculator
- Currency note counter
- Triangle validation and classification
- Quadratic equation solver
- Profit/Loss calculation
- Temperature conversion
- Number sign checking
These programs are useful for beginners practicing Java programming.
- Clone this repository:
git clone https://github.com/your-username/java-programs.git
- Open the project in any Java-supported IDE (Eclipse, IntelliJ, VS Code, etc.).
- Compile and run the Java files as needed.
Each program is self-contained and can be run individually. Example:
javac Weekday.java
java Weekday
Program | Description |
---|---|
Weekday.java | Inputs a week number (1-7) and prints the corresponding day |
MonthDays.java | Inputs a month number (1-12) and prints the number of days |
CountNotes.java | Counts the total number of notes in a given amount |
TriangleValidityByAngles.java | Checks if a triangle is valid using angles |
TriangleValidityBySides.java | Checks if a triangle is valid using sides |
TriangleType.java | Identifies if a triangle is equilateral, isosceles, or scalene |
QuadraticEquation.java | Finds the roots of a quadratic equation |
ProfitLoss.java | Determines profit or loss based on cost and selling price |
TemperatureConverter.java | Converts temperature between Fahrenheit and Celsius |
CheckSign.java | Determines if a number is positive, negative, or zero |
This project is licensed under the MIT License. Feel free to use and modify as needed.
Feel free to fork this repository and submit pull requests with improvements or additional programs!
Happy Coding! 🚀