\documentstyle[12pt]{report}

\pagestyle{myheadings}
\def\headlineaux{\sc Math 220/317: Programming II/Data Structures
\hrulefill
}
\markboth{\headlineaux}{\headlineaux}

\setlength{\textwidth}{6.25in}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}

\newcommand{\assignmentNumber}{1}
\newcommand{\outdate}{1 September, 1994}
\newcommand{\duedate}{13 September, 1994}

\begin{document}
\begin{titlepage}\begin{centerline}{\Huge \framebox{Burt Rosenberg}}
\end{centerline}\end{titlepage}

\section*{Problem Set \assignmentNumber \hfill{\parbox{3in}
    {\small\sc\begin{flushright} Out: \outdate
     \\ Due: \duedate\end{flushright}}}}


\subsection*{Goals}

Introduction to Loop Invariants and Data Objects.

\subsection*{Reading Assignment}

Review chapters 5, 7 and 8 in {\em Condensed Pascal.}

\subsection*{Assignment}

Supplement the procedures \verb.writeln_myString. and
\verb.readln_myString. with the following functions.
Document your loops with Preconditions, Loop Invariants and
Postconditions.

\begin{verbatim}
procedure copy_myString( var dest : myString; src : myString ) ;
(*   makes a copy of src in dest. src is unchanged. *)
procedure append_myString( var dest : myString; src : myString ) ;
(*   appends src to the end of dest, src is unchanged. *)
function length_myString( s : myString ) : integer ;
(*   returns integer length of s. *)
function compare_myString( s1 : myString ; s2 : myString ) : boolean ;
(*   returns TRUE iff s1=s2. Two myStrings are equal iff they
     are the same length and have the same character in each
     position. *)
\end{verbatim}

Write a procedure to take the first full word off of a myString,
placing it in a second user provided myString.
Words are delimited by white-space and all punctuation except the
hyphen.

\begin{verbatim}
procedure parse_myString( var src : myString ; var oneWord : myString ) ;
(*    the first word is taken off of src and placed in oneWord.
      if there is no more words in src, oneWord is returned with
      the empty string. src is updated, removing oneWord, i.e.
      successive calls to parse_myString will give successive
      words from src. *)
\end{verbatim}

Combine the procedures into a test program which rewrites
the input to the output, one word on a line, staring the line
if the word appears just after a copy of itself.
Spawn a subprocess to accept input from a file named {\em test.run.}
\begin{verbatim}
$ type test.run
run test.exe
  Romeo, Romeo!   wherefore
  art    thou,    Romeo   ?
$ spawn/input=test.run
%DCL-S-SPAWNED, process BURT_1 spawned
%DCL-S-ATTACHED, terminal now attached to process BURT_1
 Romeo
*Romeo
 wherefore
 art
 thou
 Romeo
%DCL-S-RETURNED, control returned to process BURT
$
\end{verbatim}
Create subdirectories \verb.INBOX. and \verb.OUTBOX. on your
VMS accounts. Place the program, test.run files and additional
test programs in \verb.OUTBOX. before class on the due date.

\end{document}
