Code Monkey home page Code Monkey logo

simple-calculator's Introduction

Calculator Documentation

Introduction

This is a simple calculator script created by Shashanka Shekhar Sharma and Chaitanya Singh Negi. The calculator supports basic arithmetic operations, trigonometric functions, solving quadratic and cubic equations, computing logarithms, calculating factorials, and plotting polynomial graphs.

Features

  • Arithmetic Operations: Addition, subtraction, multiplication, and division of numbers.
  • Trigonometric Functions: Sine, cosine, tangent, secant, cosecant, cotangent, and their respective inverse functions.
  • Quadratic and Cubic Equations: Solve quadratic and cubic equations with real and complex roots.
  • Logarithms: Compute logarithms with specified bases.
  • Factorials: Calculate the factorial of a given number.
  • Polynomial Graphs: Plot the graph of a polynomial equation.
  • History Tracking: Save the history of calculations to a CSV file.

Usage

  1. Run the script.
  2. Choose the desired operation from the menu.
  3. Follow the prompts to input the necessary values.
  4. View the result and choose whether to continue with the current result or start a new operation.
  5. Optionally, type "history" to view the history of calculations.

Instructions

  • History: Typing "history" at the operation choice prompt will display the history of calculations from the CSV file.

Dependencies

The script requires the following Python modules:

  • math: For mathematical operations.
  • csv: For handling CSV files.
  • os: For file system operations.
  • time: For measuring the time spent on the calculator.
  • numpy: For numerical operations.
  • matplotlib: For plotting graphs.

CSV File

The calculator saves the history of calculations to a CSV file named "calculator_history.csv." The CSV file contains two columns: "Operation" and "Result."

Contributors

  • Shashanka Shekhar Sharma
  • Chaitanya Singh Negi

Acknowledgments

The script was developed as a collaborative effort and is open for contributions and improvements. Feel free to explore and enhance its functionality!

simple-calculator's People

Contributors

shashankashekharsharma avatar chaitanyasinghnegi avatar

Watchers

 avatar

Forkers

aaryananand10

simple-calculator's Issues

Volume Calculator

Feature to find Volume

  • Cube: Formula: Volume = side * side * side
  • Cuboid (Rectangular Prism): Formula: Volume = length * width * height
  • Sphere: Formula: Volume = (4/3) * π * radius * radius * radius
  • Cylinder: Formula: Volume = π * radius * radius * height
  • Cone: Formula: Volume = (1/3) * π * radius * radius * height
  • Pyramid: Formula: Volume = (1/3) * base_area * height
  • Prism: Formula: Volume = base_area * height
  • Tetrahedron: Formula: Volume = (1/6) * √2 * edge * edge * edge
  • Triangular Prism: Formula: Volume = (1/2) * base * height * length

Area Calculator for Shapes

Area Calculator

2D Shapes

  • Square: Formula: Area = side * side
  • Rectangle: Formula: Area = length * width
  • Triangle:Formula (Heron's formula): Area = √(s * (s - a) * (s - b) * (s - c)), where s = (a + b + c) / 2
  • Circle:Formula: Area = π * radius * radius
  • Trapezoid: Formula: Area = 0.5 * (a + b) * h, where a and b are the lengths of the parallel sides, and h is the height.
  • Parallelogram: Formula: Area = base * height

3D Shapes

  • Cube: Formula: Surface Area = 6 * side * side, where side is the length of a side.
  • Cuboid (Rectangular Prism): Formula: Surface Area = 2 * (length * width + length * height + width * height)
  • Sphere: Formula: Surface Area = 4 * π * radius * radius
  • Cylinder: Formula: Surface Area = 2 * π * radius * (radius + height)
  • Cone: Formula: Surface Area = π * radius * (radius + slant_height), where slant_height = √(height * height + radius * radius)
  • Pyramid: Formula: Surface Area = (base_perimeter * slant_height) / 2 + base_area, where base_perimeter is the perimeter of the base and base_area is the area of the base.

Looping statements

If a user has done an operation, the user must be asked if he/she wants perform another operation on that operation again, if yes do it and if no go back to the main menu

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.