Skip to content
/ FSE Public

Educational project for the course Foundations of software engineering. The goal of the project is to create a repository, read-me, unit tests, automated testing (GitHub actions)

Notifications You must be signed in to change notification settings

D-314/FSE

Repository files navigation

Calculator

The programm can parse and calculate different mathematical expressions.

What programm can do?:

  • calculate the simplest arithmetic operations: "+", "-", "*", "/", "%", "!", "p" (exponentiation p), "s" (sqrt)
  • set and use variable values
  • parse expressions with brackets and various mathematical expressions including all possible arithmetic operations and setted variables
  • use integer and floating point numbers up to 3 decimal places

How to use it?:

  • use ";" in the end of the string (!!!)
  • to calculate simple mathematical expression just type it
  • to use variables you need to set them first
  • to set variables you need to type "let [variable_name] = [value];"
  • [variable_name] can be only one (lowercase or uppercase) letter (but not "p", "s" or "q" as it is already in list of arithmetic operations or used for service)
  • to change variable value use "let [variable_name] = [value];" again
  • to exit the programm type "q"

Some examples of usage:

> let a = 15;
= 15.000
> let b = 14;
= 14.000
> a+b;
= 29.000
> a-b;
= 1.000
> (((13 - 16) / 3 - 24) / 5 + 4) * 7;
= -7.000
> 5!;
= 120.000
> {15+(18-14)*3}/3;
= 9.000
> 5%3;
= 2.000
> 15.5 +16.5;
= 32.000
> 15.253 + 234.1235;
= 249.377
Screenshots

Quickstart

to install in linux from nothing enter the following commands:

sudo apt update
sudo apt install git build-essential -y
git clone https://github.com/Viroslav/SFE.git
cd SFE
make
./Calculator.out

If you work from root just do not use sudo.

Tests

to run tests enter the following commands after quikstart:

make test
./test.out

About

Educational project for the course Foundations of software engineering. The goal of the project is to create a repository, read-me, unit tests, automated testing (GitHub actions)

Resources

Stars

Watchers

Forks

Packages

No packages published