{ Here is the code I showed you in class on Monday. Strings are stored as linked lists of characters (that is, each node in the list contains a character and a pointer to the next node). 1. Try running this program. Work through the code for ReadString and WriteString to make sure you understand how they work. 2. Modify ReadString to stop reading at a space or a tab or eoln, instead of just eoln. When you run the program again and type "big dog" as input, the program should print out just "big". 3. Write and test a new procedure called Decapitalize. I have provided you with a stub and a description of Decapitalize below. (Does it work with the prototype I gave you? Why don't you need to make str a variable parameter?) } program stringsAsLists(input,output); type nodePtr = ^node; node = record data : char; next : nodePtr end; var message : nodePtr; { ReadString reads characters from the keyboard until reaching the end of a line. The characters are put into a linked list, with str pointing to the head of the list (which is also the first character read). } procedure ReadString( var str : nodePtr ); var currentNode : nodePtr; begin if eoln then str := nil else begin new( currentNode ); read( currentNode^.data ); str := currentNode; while not eoln do begin new( currentNode^.next ); currentNode := currentNode^.next; read( currentNode^.data ) end; currentNode^.next := nil end end; { WriteString prints a string stored as a linked list of characters. } procedure WriteString( str : nodePtr ); var currentNode : nodePtr; begin currentNode := str; while currentNode <> nil do begin write( currentNode^.data ); currentNode := currentNode^.next end end; { Decapitalize changes all the upper-case letters in the list pointed to by str to lower-case. } procedure Decapitalize( str : nodePtr ); begin end; begin write( 'Type something: ' ); ReadString( message ); write( 'You typed: ' ); WriteString( message ); writeln end.