This repository contains the source code for an advanced Java calculator. The calculator is a console application that allows users to perform various arithmetic and advanced mathematical operations such as addition, subtraction, multiplication, division, exponentiation, trigonometric functions, logarithmic functions, and factorials.
- Perform basic arithmetic operations: addition, subtraction, multiplication, and division
- Calculate exponentiation (raising a number to a power)
- Calculate trigonometric functions: sine, cosine, and tangent
- Calculate logarithmic functions: base 10 and natural logarithm (base e)
- Calculate factorials of non-negative integers
- Interactive menu-driven interface
- Easily extendable to support more operations
- Java Development Kit (JDK) 8 or higher
- Clone the repository or download the source code:
git clone https://github.com/yourusername/advanced-java-calculator.git
- Navigate to the project directory:
cd advanced-java-calculator
- Run the compiled Java class:
java AdvancedCalculator
- When the calculator starts, you will see a menu with available operations:
Advanced Calculator
1. Add
2. Subtract
3. Multiply
4. Divide
5. Exponentiation
6. Sine
7. Cosine
8. Tangent
9. Logarithm (base 10)
10. Natural Logarithm (base e)
11. Factorial
12. Exit
Enter your choice (1-12):
-
Enter the number corresponding to the desired operation.
-
Provide the required operands (two numbers) when prompted.
-
The result of the operation will be displayed.
-
The calculator will return to the main menu, where you can choose another operation or exit the application by selecting option 6.
Contributions to this project are welcome! If you'd like to improve the code, add new features, or fix bugs, please follow these steps:
- Fork the repository on GitHub.
- Create a new branch for your changes.
- Make changes or additions to the code in your branch.
- Test your changes to ensure the application still works correctly.
- Create a pull request with a clear description of your changes.
I will review your pull request and provide feedback or merge your changes into the main repository.
This project is licensed under the MIT License. You are free to use, modify, and distribute the code as long as you follow the terms of the license.