Calculator v1.0 is a command-line based and GUI scientific calculator developed in C++17. It allows users to perform arithmetic calculations, plot graphs of functions, and calculate the values of variables. The program is built using the Model-View-Controller (MVC) pattern, and its classes are implemented within the SmartCalc
namespace. The calculator can handle both integers and real numbers with a dot, and allows input of numbers in exponential notation.
The program can be built using the Makefile provided. The following targets are available:
all
: builds the program and runs theinstall
target.build
: installs the program.rebuild
: removes any existing installation of the program, builds it, and installs it.install
: installs the program.unistall
: removes the program from the system.clean
: removes any existing installation of the program and cleans up any build artifacts.cppcheck
: runs thecppcheck
tool to check for errors in the code.clang-format
: runs theclang-format
tool to format the code.tests
: builds and runs the unit tests for the program.
To build the program, run the following command:
make all
After building the program, run it using the following command:
./Calculator
This will launch the GUI-based calculator. The program will accept input of arithmetic expressions and plot graphs of functions.
The program depends on the following libraries:
- GTest
- Qt 6
The code for this project is located in the sourse
folder. Classes are implemented within the SmartCalc
namespace. The project follows the Google style guide for C++ code.
- To perform arithmetic calculations, simply enter an arithmetic expression into the calculator and press
=
. The result will be displayed in the output area. - To plot a graph of a function, enter an expression in infix notation with the variable
x
. Then click on thePlot Graph
button. The graph will be displayed in the output area. - To calculate the value of a variable, enter an expression in infix notation with the variable
x
, and then click on theCalculate
button. The result will be displayed in the output area.
This project is licensed under the MIT License. See the LICENSE file for more information.