Question: Please I need help with C++ strings within one hour.. easy task.. ACSL Enclosure PROBLEM: Given string data input representing a mathematical expression, determine the
Please I need help with C++ strings within one hour.. easy task..

ACSL Enclosure PROBLEM: Given string data input representing a mathematical expression, determine the possible location(s) of the missing parenthesis. Although we show spaces between characters for readability, the input strings will have no spaces. All operands will be single digits. Given ( 2 + 3 *6+1. A right parenthesis is missing. It could be correctly placed in several locations: ( 2 + 3) *6+1 Location 5 ( 2 + 3 * 6) +1 Location 7 ( 2 + 3 * 6+1) Location 9 INPUT: There will be five lines of input. Each line will contain a string of characters with no spaces representing a mathematical expression. Each expression will have either a single left or right parenthesis. The operators used will be: +,-,* and 7. OUTPUT: For each line of input, list all the locations in that expression where the missing left or right parenthesis can be correctly placed. Note: single digits are never enclosed. SAMPLE INPUT SAMPLE OUTPUT 1. (2+ 3 *6 + 1 1. 5, 7,9 2. 2-5 *(6+1 2. 9 3. 5+5 - 2) *5 3. 1,3 4. 3 *5 + ( 874 *2) 4. 9, 11 5. 2 +8/4* 5) 5. 1, 3, 5
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
