Wiles / java-calc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-calc

Java CI codecov

To refamiliarize myself with Java tools I decided to port my old C++ infix notation parser to Java. Supports parenthesis, addition, subtraction, multiplication and division. Originally based on an excersice from Bjarne Stroustrup's Programming: Principles and Practice Using C++.

prerequisites

  • Java 11
  • Maven 3

build

From <project_dir>/calc run mvn package.

run

From <project_dir>/calc run java -jar target/calc-1.0-SNAPSHOT.jar [expression...]

Example use:

> java -jar target/calc-1.0-SNAPSHOT.jar 1+1 "3*7" "5(2+3)"
1+1 = 2
3*7 = 21
5(2+3) = 25

About

License:Apache License 2.0


Languages

Language:Java 100.0%