+ 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 :)

8th Apr 2017, 2:09 PM
Pixie
Pixie - avatar
9 Respuestas
8th Apr 2017, 3:47 PM
Karl T.
Karl T. - avatar
+ 10
One I liked was "Programming Languages Concepts and Constructs" by Ravi Sethi.
8th Apr 2017, 4:10 PM
Karl T.
Karl T. - avatar
+ 10
And for compiler theory, the one known as the "Dragon book" which is "Compilers : Principles Techniques and Tools" by the same author.
8th Apr 2017, 4:13 PM
Karl T.
Karl T. - avatar
+ 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.
8th Apr 2017, 4:00 PM
Karl T.
Karl T. - avatar
+ 9
Books from my CS classes, mainly computer language/compiler theory.
8th Apr 2017, 4:06 PM
Karl T.
Karl T. - avatar
+ 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.
8th Apr 2017, 3:56 PM
Pixie
Pixie - avatar
+ 7
You learnt these techniques through books? Or lectures?
8th Apr 2017, 4:05 PM
Pixie
Pixie - avatar
+ 7
I'd be grateful if you could suggest a few, except the one by Stroustrup :)
8th Apr 2017, 4:09 PM
Pixie
Pixie - avatar
+ 7
I'll look into it. Thanks
8th Apr 2017, 4:14 PM
Pixie
Pixie - avatar