Answer to Question #81083 in C++ for Nick Elam

Question #81083
Write a program that implements the algorithm delimterMatching()

delimiterMatching(file)

read character ch from file;

while not end of file

if ch is '(', '[', or '{'

puch(ch);

else if ch is ')', ']', or '}'

if ch and popped off delimiter do not match

failure;

else if ch is '/'

read the next character;

if this character is '*'

skip all characters until '*/' is found and report an error

if the end of the file is reached before '*/' is encountered;

else ch = the character read in;

continue; // go to the beginning of the loop;

// else ignore the other characters;

read next character ch from file;

if stack is empty

success;

else failure;
1
Expert's answer
2018-09-19T04:10:24-0400
Dear Nick Elam, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS