kanohapierre / string-calculator-challenge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

String Calculator Challenge

The aim of this challenge is to implement a simple integer calculator. The calculator takes a string of space-separated numbers and operators (like "1 + 2 + 3" or "10 + 4 - 5") and returns the result of the calculation.

It should resolve the following sums:

  • "1"
  • "1 + 1"
  • "1 + 2 + 3"
  • "10 - 6"
  • "10 + 5 - 6"
  • "10 * 5"

If an operator isn't known, an exception should be thrown.

About

License:Apache License 2.0


Languages

Language:Java 100.0%