{ recursion.p Started by Jeff Ondich some time in 1993 Last modified 1/20/97 The procedure "WriteMessage" is recursive. That is, it calls itself. Answer these questions. 1. Is this sort of thing allowed? Does this program compile? 2. Don't run the program yet. First, what do you expect this program to do? 3. Run it. What happened? If there was an error message, write it down or remember it. 4. Modify the program to show how many times WriteMessage gets called before the program fails. Now try it, and write down the number of calls before failure. Is this count the same every time you run the program? 6. Change the 10000 to 5000. Now how many times does WriteMessage get called before it fails? Try again with 2500 and 1000. What's going on? } program recursion(input,output); type stringType = string[10000]; var theMessage : stringType; procedure WriteMessage( message : stringType ); begin writeln( message ); WriteMessage( message ) end; begin write( 'What''s your message? ' ); readln( theMessage ); WriteMessage( theMessage ) end.