An extended version of the usual calculator is implemented, which can be found in the standard applications of each operating system in the C and C++ programming languages using structured programming
The SmartCalc v1.0 program implemented:
- The program developed in C language of C11 standard using gcc compiler. I used some additional QT libraries and modules
- The program can be built with Makefile which contains standard set of targets for GNU-programs: all, install, uninstall, clean, dvi, dist, tests, gcov_report. Installation directory could be arbitrary, except the building one
- There is full coverage of modules related to calculating expressions with unit-tests using the Check library
- GUI implementation, based on any GUI library with API for C11 (Qt, OpenGL)
- Both integers and real numbers with a dot can be input into the program.
- The calculation will be done after you complete entering the calculating expression and press the
=symbol. - Calculating arbitrary bracketed arithmetic expressions in infix notation
- Calculate arbitrary bracketed arithmetic expressions in infix notation with substitution of the value of the variable x as a number
- Plotting a graph of a function given by an expression in infix notation with the variable x (with coordinate axes, mark of the used scale and an adaptive grid)
- Domain and codomain of a function are limited to at least numbers from -1000000 to 1000000
- To plot a graph of a function it is necessary to additionally specify the displayed domain and codomain
- Verifiable accuracy of the fractional part is at least to 7 decimal places
- Users are able to enter up to 255 characters
- Bracketed arithmetic expressions in infix notation supports the following arithmetic operations and mathematical functions:
-
Arithmetic operators:
Operator name Infix notation
(Classic)Prefix notation
(Polish notation)Postfix notation
(Reverse Polish notation)Brackets (a + b) (+ a b) a b + Addition a + b + a b a b + Subtraction a - b - a b a b - Multiplication a * b * a b a b * Division a / b / a b a b \ Power a ^ b ^ a b a b ^ Modulus a mod b mod a b a b mod Unary plus +a +a a+ Unary minus -a -a a- Note that the multiplication operator contains the obligatory sign
*. Processing an expression with the omitted*sign is optional and is left to the developer's decision -
Functions:
Function description Function Computes cosine cos(x) Computes sine sin(x) Computes tangent tan(x) Computes arc cosine acos(x) Computes arc sine asin(x) Computes arc tangent atan(x) Computes square root sqrt(x) Computes natural logarithm ln(x) Computes common logarithm log(x)
-
There is a special mode "credit calculator":
- Input: total credit amount, term, interest rate, type (annuity, differentiated)
- Output: monthly payment, overpayment on credit, total payment
Below you can see the operation of the program and an example of calculations:

