Code Monkey home page Code Monkey logo

fse's Introduction

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

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.