In-class Lab Assignment

October 5, 2006

 

This assignment is to be completed during the class period and submitted to the Digital Dropbox as yourname4 at the end of the period WHETHER OR NOT YOU HAVE COMPLETED IT CORRECTLY.  If you can not finish it, submit it anyway and then go home and finish it over the weekend and re-submit it with the same name but add a comment saying with the words “final version”.   PLEASE do NOT submit MULTIPLE FINAL versions.  It MUST be completed by the start of class on Tuesday, Oct 10th.  Bring print-outs of your FINAL version to class on Tuesday with your test input and the output produced by your program.  Do NOT include them with your electronic submission and therefore don’t zip your file.

 

Write a Pascal program which will use an array of Strings where the Strings  are defined by your program to be a packed array of characters.  The problem you are to solve is that  of reading in words  from a FILE where there may be multiple words on a line.  The words will all be less than or equal to 10 characters in length.  The words are separated by a blank (i.e. that is how you can determine where a word ends).   You should read until there are no more words left (i.e. you have reached the end of file – Pascal has an EOF function).  There will not be more than 25 words.  Once you have read in all the words,  print them out  to the output file in alphabetical order, one per line.  

As usual