Welcome to the Simple Calculator project! This interactive tool is designed to perform a variety of mathematical operations, including arithmetic, comparison, and trigonometric calculations.
- Arithmetic Operations: Add, subtract, multiply, divide, and more!
- Comparison Operations: Compare two numbers with various operators.
- Trigonometric Functions: Calculate sine, cosine, tangent, and hyperbolic functions.
-
Start
-
Display Welcome Message
- Print a welcome message with options for operations.
- Prompt for Arithmetic Operations
- Ask the user if they want to perform arithmetic operations (Y/N).
-
If User Chooses Arithmetic (Y) Prompt for the type of arithmetic operator (e.g., +, -, *, /, %, **). Prompt for result type (Integer/Float). Input two numbers (num1
and
num2'). -
Perform Selected Arithmetic Operation
- If Addition: Calculate result and display in a table.
- If Subtraction: Calculate result and display in a table.
- If Multiplication: Calculate result and display in a table.
- If Division:
- Check for division by zero. If valid, calculate and display result.
- If Modulus: Calculate result and display in a table.
- If Exponentiation: Calculate result and display in a table.
- If Floor Division: Calculate result and display in a table.
- Else: Print invalid operator message.
- If User Chooses Comparison (N) Prompt for comparison operations (Y/N).
- If user chooses (Y):
Input two numbers (num1
and
num2`). Prompt for comparison operator (e.g., ==, >, <). Evaluate and display result in a table.
- If User Chooses Trigonometry (N Prompt for trigonometric operations (Y/N). If user chooses (Y):
- Input angle in degrees (num1'). Convert angle to radians. Prompt for trigonometric operator (e.g., Sin, Cos, Tan). Calculate and display result in a table.
-
If User Chooses No Operations Display a message asking why they are using the calculator.
-
End
-
Clone the Repository:
git clone https://github.com/Wreaking/calculator.git
-
Navigate to the Project Directory:
cd calculator
-
Run the Calculator: Open your terminal and execute:
python calculator.py
-
Follow the Prompts: The calculator will guide you through various operations.
- Arthimethic Operation:
- Comparision Operation:
- Trignometric Operation:
This project is licensed under the Apache License. See the LICENSE file for details.
- Thanks to PrettyTable for making table outputs more presentable.