Place a result into each method call to indicate what would happen if the method call were inserted at line 9.
Place the fragments into the program, so that the program will get lines from a text file, display them…