Suppose an expression is represented in a string (i.e.,35 * 4 + 5 / XXXXXXXXXXWrite a function that splits the expression into numbers, operators, and parentheses.The function takes an expression as...


Suppose an expression is represented in a string (i.e.,35 * 4 + 5 / (4 + 5)). Write a function that splits the expression into numbers, operators, and parentheses.The function takes an expression as the argument and returns a vector of strings. Each string represents a number, an operator, or a parenthesis. The header of the function is given as follows:



vector split(conststring& expression)




For example,split("35 * 4 + 5 / (4 + 5)")returns a vector that contains the strings35,*,4,+,5,/,(,4,+,5,).




Write a test program that prompts the user to enter an expression and displays the numbers and then the non-number items. For example, if the user enters(4 + 50) * 5, the program displays4,50,5,(,+,), and*in this order.



Nov 03, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here