Question
while(true){//repeat while we will not reach till end of file char ch; myFile>>ch; if (myFile.eof()) break; switch(ch){ case '+':cout <
while(true){//repeat while we will not reach till end of file char ch; myFile>>ch; if (myFile.eof()) break; switch(ch){ case '+':cout<<"PLUS"< I have this c++ code it reads a file that contains this < > * ( ) ; / / - + LT GT STAR LPAREN RPAREN SC SLASH SLASH MINUS PLUS if the file has this < > * ( ) ; / / - + "hello" + - the output would be LT GT STAR LPAREN RPAREN SC SLASH SLASH MINUS PLUS SCONST (hello) PLUS MINUS If the file has this, > * ( ) ; / - + "hello how are you " + the outbut would be this GT STAR LPAREN RPAREN SC SLASH MINUS PLUS SCONST (hello how are you) PLUS Now i need help with this if i file containes this ; "hello this broken" it would print this Error on line 1 ("hello this ) so if a file contained this + "hello this is ok" "this is not ok" it woukd print PLUS SCONST (hello this is ok) Error on line 2 ("this is not ) so basically if the words in the quotes are broken into different lines it sould return the error. If it is not broken up it will return SCONST along with the string, but that is already handled in the provided code. i need help with the error case. please show the correct outputs to see that the code actaully works,
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started