Question: You should use the .java file provided here, modify it appropriately, and upload your solution. You may modify anything you like, but it has a
Program output Here are the outputs your program may produce: Valid trace Maximum call depth was DEPTH for valid traces, and the output of Invalid trace at line LINENUMBER followed by one of the following: Returning from FUNCTION1 instead of FUNCTION2 Returning from FUNCTION which was not called Not all functions returned followed by a stack trace. The difference between the first two errors is whether any functions are on the stack. See (and use) the executables below for details. Your program should produce only one of these statements per document. In addition, if the trace is invalid, your program should produce the stack trace (the functions on the stack when the error is detected), one line per function. If there are multiple errors, print only the first one detected (earliest in the input). The terms in all-caps are defined as follows: DEPTH: the number of items on the stack LINENUMBER: the line number of the input (where the error is detected) FUNCTION1, FUNCTION2, FUNCTION: names of functions (FUNCTION1 is the function that is trying to return, while FUNCTION2 is the function on top of the stack)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
