Exercise: Group Printed Report  
                  
                  
Follow the "Group Printed Report" link under "Programming Examples" on the
   the CS233 page for help in answering the following questions. The file 
   "motoclozG.txt" is ordered by the group item; and it has an id in 0-4,
   article name in 5-29, category(group) in 30-40 and price in 41-46.
   
1. Show how to issue an open for reading from the file "motoclozG.txt" and 
   assign the return value to a file pointer named $fp. Have a "primer read"
   to take input from fgets() referencing the file pointer $fp. 
   
  
2. An outer loop is continue for all records in the Motorclothes file.
   Initialize a group control variable with the group input value before an 
   inner loop that is to continue for all records in a group (e.g. "Boots").
   At the top of the inner loop, test whether the group value is the same or
   has changed(e.g. to "Heated Gear"). A change is called a "control break"
   and signals the need to reset the control variable after an exit from 
   the inner loop. Within the inner loop, accumulate the price and have a
   "read next" to attempt to input another motorclothes record.

   
3. After each control break, print a control group footing lines with group
   value and price total. This code may be incorporated within the statement
   block for reinitializing a new group (i.e. processing a "control break").

   
4. Other refinements would be to format report heading, column headings, and
   and a "grand" total for all control groups to be printed after the last 
   control footing line.


motoclozG.txt(records ordered by group):
98000Engineer                 Boots      140.00
98424Street Trooper           Boots      150.00
98107Electric Jacket Liner    Heated Gear220.00
98113Electric Gloves          Heated Gear165.00
97212Full Face                Helmet     250.00
98026Shortie                  Helmet     115.00
98160Open Face                Helmet     139.00
98100Jacket                   Leather    225.00
98111Shirt                    Leather    195.00
98480Chaps                    Leather    175.00
97220Overboots                Raingear    89.00
97325Packable Jacket and PantsRaingear   199.00
98170GoreTex Rain Gloves      Raingear    59.00
98354One-piece Rain Slicker   Raingear    95.00
98358Two-piece Rainsuit       Raingear   100.00