Question: Implement simple calculations (+. .. *, /, % (mod)). At the very least, you should be able to perform each of these math operations on
Implement simple calculations (+. .. *, /, % (mod)). At the very least, you should be able
to perform each of these math operations on two numbers. (2+2 should work, but
2+2+2 does not need to just yet).
a. Review string parsing concepts to tokenize the string in your textbox into separate
tokens. If "5 5*20" is in your textbox, pressing = should parse "5.5" and "-20: as
floating point values and """ as the operation to occur between those two values.
There are several ways to do this.
b. waWidgets comes with it's own wixString Tokenizer that you may use, You also have
the option to make your own tokenizer, but this is not recommended for this
assignment.
2. Simple unary operations (Sin, Cos, Tan) should also be implemented, Pressing Sin and 5
should add "Sin 5" to your textbox, and pressing = should result in the Sine of 5.
a, Unary operations should still be added as a string to your text box, Do not
immediately evaluate numbers in your textbox. The equals button should still be
pressed in order to evaluate any expressions, including unary operations.
3. Try to find a way to implement the event table without having everything hardcoded.
You should be able to handle all events in a single event function
to perform each of these math operations on two numbers. (2+2 should work, but
2+2+2 does not need to just yet).
a. Review string parsing concepts to tokenize the string in your textbox into separate
tokens. If "5 5*20" is in your textbox, pressing = should parse "5.5" and "-20: as
floating point values and """ as the operation to occur between those two values.
There are several ways to do this.
b. waWidgets comes with it's own wixString Tokenizer that you may use, You also have
the option to make your own tokenizer, but this is not recommended for this
assignment.
2. Simple unary operations (Sin, Cos, Tan) should also be implemented, Pressing Sin and 5
should add "Sin 5" to your textbox, and pressing = should result in the Sine of 5.
a, Unary operations should still be added as a string to your text box, Do not
immediately evaluate numbers in your textbox. The equals button should still be
pressed in order to evaluate any expressions, including unary operations.
3. Try to find a way to implement the event table without having everything hardcoded.
You should be able to handle all events in a single event function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
