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...

1 answer below »

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.






Answered 99 days AfterNov 02, 2021

Answer To: Suppose an expression is represented in a string (i.e.,35 * 4 + 5 / XXXXXXXXXXWrite a function that...

Vaibhav answered on Feb 10 2022
122 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here