+ 6
Has anybody made a great calculator program?
It should be capable of performing more than one operation at a time. It should be able to process more than 2 operands. It should follow BODMAS Operators +*-/ () I've been thinking about making one. But if anybody has already made one of these, it would be my pleasure to check it out. TIA :)
9 Answers
+ 10
+ 10
One I liked was "Programming Languages Concepts and Constructs" by Ravi Sethi.
+ 10
And for compiler theory, the one known as the "Dragon book" which is "Compilers : Principles Techniques and Tools" by the same author.
+ 9
Thanks. I used a lexical/parser approach that is similar to what is used to compile code. I have a longer version on my PC that evaluates popular math functions like sin(), cos() etc. and floating point numbers - but it's a bit too big for SL compiler.
+ 9
Books from my CS classes, mainly computer language/compiler theory.
+ 7
@Helioform. Nicely done mate. Although tbh I have no idea what the heck that code is. I'll run it on desktop anyway. I need to learn about Tokens and enums i guess.
I was thinking about extracting the characters and cross checking them using functions for each operation. Figured I'd need many lines of code for that.
+ 7
You learnt these techniques through books? Or lectures?
+ 7
I'd be grateful if you could suggest a few, except the one by Stroustrup :)
+ 7
I'll look into it. Thanks