Course Content
test daily challenge
test daily challenge
challenge 1
Swipe to show code editor
Implement a basic calculator that can evaluate a mathematical expression provided as a string input. The calculator should support the following operations: addition (+
), subtraction (-
), multiplication (*
), division (/
), and parentheses for grouping. The calculator should handle operator precedence correctly and be able to process expressions that include whitespace.
Examples
Input:
Output
Thanks for your feedback!
challenge 1
Swipe to show code editor
Implement a basic calculator that can evaluate a mathematical expression provided as a string input. The calculator should support the following operations: addition (+
), subtraction (-
), multiplication (*
), division (/
), and parentheses for grouping. The calculator should handle operator precedence correctly and be able to process expressions that include whitespace.
Examples
Input:
Output
Thanks for your feedback!