BONUS ASSIGNMENT - RULES
________________________

As announced in class, you have the opportunity of a bonus assignment.

Here are the rules for the bonus assignment, which is to write function named
process() (suitable for use with the filter program) and which is attached to
this message.

1.    You may submit your version of the "bonus" function to earn up to 10
      marks.  The bonus will be added to your regular score, but you will not be
      allowed to score more than 100% for the whole course.

2.    The bonus function MUST be submitted via the testing service.  I will
      automatically get the results from there.  Do NOT e-mail your functions to
      "perry" they will NOT qualify.  Note there is no difference to you except
      the mail address, "tscrp" instead of "perry".  I will test whatever you
      send using Borland C++ if it will not compile on the testing service. 
      This removes the effect of any differences in the compilers, HOWEVER, you
      will not get any marks for code that will not compile under strict ANSI
      rules.

3.    I am e-mailing to you a test-script to use for the testing.  You should
      save that test-script and submit it with your program code for the
      testing.  When you save the test-script from the mail message it must be
      named PROCESS.SCR. There is no trick to this, just add PROCESS.SCR to the
      list of files you submit using TESTIT.

4.    The documentation of your code MUST be complete, and must indicate that
      you followed a procedure in which you planned the solution before you
      coded it.  The comments must include a "plan" or "pseudo-code" as comments
      at the start of the function, and the code must relate to the plan!

5.    The cutoff time and date is MIDNIGHT on 30th April, 1998. If you get
      successful results back via e-mail before the deadline you do not have to
      resubmit another test ... I get a copy of your successful results and your
      code from the testing service.

=======================================

      ISYS290 BONUS ASSIGNMENT
     
     Write and test a function which has the following prototype
     and specification:

          int process( char* d, char* s);

     The purpose of the function is to make corrections to the
     grammar of the input text, limited to the description below.

     The function receives text in parameter 2 (string s).  The
     text arrives one line at a time.

     The function examines the text and modifies it, if necessary
     as described below, and moves the output to parameter 1
     (string d).

     The output (string d) text should be a modified to ensure that
     the first word of each sentence starts with an upper case
     letter, followed by lowercase letters, and that all other
     words consist only of lower case letters.

     NOTE: The first word received when the program runs will be
     the start of a new sentence.  After that new sentences start
     with the first word after the period ending the previous 
     sentence (i.e. normal rules of grammar).

     The function should normally move the output into the string
     represented by parameter 1 (string d) and return 0.

     If the function finds two adjacent periods it should treat 
     this as an error.  In this case it should write a message in 
     the output (string d) as follows.

          "ERROR - adjacent periods in text: "

     followed by the current line of data and should return 1 to
     indicate the error.

     The function should never cause the contents of the string
     passed as parameter 2 to change.

     -----------------------

     SEE ACCOMPANYING NOTES re instructions and conditions!

====================test script ... save as process.scr ============

:::::::: check the test results for comments ::::::::

Testing function process() on:  Wed Mar 19 15:43:50 1997
  silent test 

>------test number 1---------
<<Data for paramter #1 ..(d)..<>..: QUESTION
<<Data for paramter #2 ..(s)..<>..: to be or not to be. that is the QUESTION.
--Expected results?
--0
--To be or not to be. That is the question.
--to be or not to be. that is the QUESTION.

<<endtest>>

>------test number 2---------
<<Data for paramter #1 ..(d)..<>..: QUESTION
<<Data for paramter #2 ..(s)..<>..: to be or not to be.. that is the QUESTION.
--Expected results?
--1
--ERROR - adjacent periods in line: to be or not to be.. that is the QUESTION.
--To be or not to be.. That is the question.

<<endtest>>

>------test number 3---------
<<Data for paramter #1 ..(d)..<>..: QUESTION
<<Data for paramter #2 ..(s)..<>..: to be or not to be. that is the QUESTION..s
--Expected results?
--1
--ERROR - adjacent periods in line: to be or not to be. that is the QUESTION..s
--To be or not to be. That is the question..s

<<endtest>>

>------test number 4---------
<<Data for paramter #1 ..(d)..<>..: QUESTION
<<Data for paramter #2 ..(s)..<>..: this.is. A.  TEST.   WHOOPEE.
--Expected results?
--0
--This.Is. A.  Test.   Whoopee.
--this.is. A.  TEST.   WHOOPEE.

<<endtest>>
