Skip to content

YanivZalach/Math_Calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Math Calculator Project

Welcome to my awesome calculator project! This C++ program can take a mathematical expression as a string and calculate the result. It supports the basic arithmetic operations (, +, -, *, /, )

The project is being compiled using Makefile with means that you need a Unix system to run it (MacOS, Linux, WSL).

And supports the order of operations.

💻 Beginner's Journey

This project represents the knowledge I've acquired so far in my journey of learning C++.

✨ Features

  • Perform arithmetic operations (, +, -, *, /, )
  • Handle complex expressions with parentheses.
  • Easy-to-use interface that support the regular way of writing mathematical expressions.
  • Written in C++ for efficiency and performance.
  • The project uses only the standard library so if you have a Compiler, you already set.

🚀 Getting Started

To use this calculator in your project, follow these simple steps:

  1. Clone this repository to your local machine:

    git clone https://github.com/YanivZalach/Math_Calculator.git ~/Documents/calculate
  2. Compile the C++ source code using Makefile:

    make all
  3. Run the program:

    ./calculator
  4. Add to .bashrc:

    alias calc="$HOME/Documents/calculate/calculator"

    Now you can run the calculator from everywhere using:

    calc

📝 Usage

You can use the calculator by providing a mathematical expression. For example:

$ calc
Math exasperation: (5 + 3) * 2 / (7 - 2)
>> 3.2

Here are some examples to try:

  • 2 + 3
  • (5 - 2) * 4 / 2
  • 10 / (2 + 3)

🌟Pay Attention

You can't write decimal numbers by using the . operator, instead use the / operator.

0.8 = (8/10)

📄 License

This project is licensed under the MIT License.

Releases

No releases published

Packages

No packages published