Can be written in any language, I will only judge Java, C, and C++. Here goes:
Code: Select all
Programming Challenge 4 / July 27, 2007
(remember today is the 84th anniversary of James Coney Island, so go down there and get as many 84 cent hot dogs as you can). Back on topic:
You've been commissioned by TI to write a working command-line version of their low-end calculator model. It will need to be able to take in a string (or char[]) of up to 88 characters, establish order of operations, and output the answer. No parentheses will be used, and there will be no spaces in the input. Output will be a simple double.
Sample input:
C:/> ti-calc 8+9+33*3*7*1+0-0-33/2/1
Sample output (Crap this took a long time to figure out) :
694.5
Rounding would be nice, but is not necessary. If implemented, round to the nearest thousandth's (or 3rd decimal place).
PM your source to me and I'll post it when next Friday. Let me know what you think of the new challenge. Good luck.
