Skip to content

rizbiislam/User-Friendly-Shell-Script-Math-Assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

🚀 User-Friendly Shell Script Math Assistant

Developed a multi-functional shell script calculator 🎛️ capable of performing 36+ mathematical operations. This project allowed me to explore Bash scripting 🖥️ and leverage various shell commands for user input, calculations, and output through a user-friendly interface.

🌟 Key Features & Operations:

🔢 Basic Arithmetic:

  1. Check Even or Odd 🔄
  2. Add Two Numbers
  3. Subtraction
  4. Multiplication ✖️
  5. Division

🧮 Advanced Mathematical Functions:

  1. Square a Number ⏹️
  2. Square Root
  3. Logarithm 📊
  4. Check Prime Number 🔍
  5. Sine (Sin x in radians) 📐
  6. Cosine (Cos x in radians) 🌀
  7. Tangent (Tan x in radians) 📏
  8. π (Pi) 𝜋
  9. e^(x) Exponential 🔺
  10. Factorial 🎯

⚙️ Bitwise Operations:

  1. AND Operation (&)
  2. OR Operation (||)
  3. NOT Operation (!)

🔄 Conversions:

  1. Convert Decimal to Octal 🔢
  2. Convert Decimal to Hexadecimal #️⃣
  3. Convert Binary to Octal 📟
  4. Convert Decimal to Binary
  5. Convert Octal to Decimal 🔄
  6. Convert Binary to Decimal
  7. Convert Binary to Hex
  8. Convert Hex to Decimal
  9. Convert Hex to Binary
  10. Convert Hex to Octal
  11. Convert Octal to Binary
  12. Convert Octal to Hex

🌡️ Temperature Conversions:

  1. °F to °C
  2. °C to K
  3. °F to K
  4. K to °F

This shell script calculator combines simplicity and versatility, offering an efficient way to handle both everyday and advanced mathematical operations.

📖 User Manual for RN Calculator

Getting Started

  1. Run the Calculator Script:

    • Open your terminal.
    • Navigate to the directory where the script is saved:
      cd /path/to/your/script
    • Make sure the script has execute permissions. If not, you can grant it permission by running:
      chmod +x calculator.sh
    • Run the calculator script with the following command:
      ./calculator.sh
  2. Initial Prompts:

    • After running the script, you will be prompted to enter your name:
      Enter Your Name:
      
    • Upon entering your name, you will receive a welcome message:
      Hello, [Your Name]! Welcome to RN Calculator.
      
  3. Starting the Calculation:

    • Next, you will see a prompt:
      Are you ready? 1 = yes / 2 = no
      
    • Press 1 to start using the calculator.

Main Menu: Mathematical Operations

Once you are ready, the calculator will display a list of operations it can perform. To select an operation, simply input the corresponding number.

Supported Operations:

  • Basic Arithmetic:

    • Addition: Add two numbers.
    • Subtraction: Subtract one number from another.
    • Multiplication: Multiply two numbers.
    • Division: Divide one number by another.
  • Mathematical Functions:

    • Square: Find the square of a number.
    • Square Root: Calculate the square root of a number.
    • Logarithm: Compute the logarithm of a number.
    • Prime Check: Determine whether a number is prime.
    • Trigonometric Functions: Sine, Cosine, Tangent (in radians).
    • π (Pi): Retrieve the value of Pi.
    • e^x: Calculate the exponential of a number.
    • Factorial: Calculate the factorial of a number.
  • Logical and Boolean Operations:

    • AND (&&), OR (||), NOT: Perform logical comparisons.
  • Conversion Functions:

    • Convert between Decimal, Binary, Octal, and Hexadecimal.
  • Temperature Conversions:

    • Fahrenheit to Celsius (°F to °C)
    • Celsius to Kelvin (°C to K)
    • Fahrenheit to Kelvin (°F to K)
    • Kelvin to Fahrenheit (K to °F)

Example Operations:

  • Addition:

    • Choose operation 2 for addition.
    • Input two numbers:
      Enter 1st Number: 5
      Enter 2nd Number: 7
      Ans: 12
      
  • Temperature Conversion (°F to °C):

    • Choose operation 23.
    • Input the temperature in Fahrenheit:
      Enter the Number: 98.6
      98.6 °F = 37 °C
      

❌ Exiting the Session

To close the session, enter 0 in the main menu. You will receive a friendly goodbye message:

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages