Inspiration

This is the latest programming challenge for me. I wanted to build the entire calculator myself, the user input, formating, parsing, and computation logic.

What it does

  1. Compute Simple Math (addition, subtraction, multiplication, division, parens)
  2. Computation can be up to 1000 characters long
  3. Computation will compute to an order of magnitude less than or equal to 1e9,999
  4. Application will format user input using a logic parser taking in only… a. Numbers 0 - 9 b. Operators [+, -, *, /] c. Parentheses (), Braces {}, and Brackets[]

How I built it

Test driven development... testCalculator(){

  1. compareCArrays()
  2. dispProgPurpose()
  3. getUserInput()
  4. displayUserInput()
  5. eliminateUserInputGarbage()
  6. formatUserInput() add opMath() and parenMath() functions to FormatingFunctions.cpp
  7. displayUserInput()
  8. calculateUserInput()
  9. displayAnswer()

Challenges I ran into

Hahahahaha.... passing in an array is the same as passing in a ptr... basically. I was trying to pass in a char array by reference. Not POSSIBLE. Don't need to.

That's the funniest one... the biggest challenge I overcame/realised is this. I started over three times, the third attempt is by far the longest attempt. The last attempt I had the goal of building code to meet test methods, and keeping my methods around 30 lines of code each (ish failing that still... way better than before).

Accomplishments that I'm proud of

Not giving up. I started this project Sept 17th last year and pretty consistently dumped time into it since then, minus october till december was slow.

What I learned

How to be patient and slowly chip away at my bigger projects.

What's next for Calculator

Finish the formating test method and the computation algorithm!!! I'm pretty excited to finish it and use it for robotics I want to build!

Built With

  • cpp
Share this project:

Updates