title: Pascal Arrays Can't figure out how to print info from arrays
body: <p>I'm trying to write a program tracks the products made by 7 machines in a factory, which all make the same 10 kinds of products.</p>
  
  <p>The program asks the user to enter the machine id (A, B, C...G)
  Then the product id (0, 1, 2...9)
  and finally the program asks for a 0 or 1 to mark the product as either good quality or bad quality.</p>
  
  <p>I put all of that information into three arrays. What I have to do next is the part I'm stuck with. I have to create two tables from all that information.</p>
  
  <p>The first table is a table of good quality products. It has to be a two dimensional table with the MachineIDs running along the top and the ProductIDs running down the side.</p>
  
  <p>There needs to be a running total for every single machine and every single product. So, in the cell [A0] needs to be a total of how many times machineA has made product0 and it was marked as GOOD. Then [A1] and so on all the way to [G9]</p>
  
  <p>The second table is exactly the same only this time only the bad products are counted.</p>
  
  <p>At the bottom there needs to be a total of ALL products made by each machine. Down the right hand side there has to be a total of ALL the individual products made be all machines.</p>
  
  <p>Here's my code so far.</p>
  
  <pre><code>program Production;
  
  var machine: array of char;
    var product: array of integer;
    var quality: array of integer;
    var min, number, extra: integer;
    var machineID: array[1..7] of char;
    var productID: array[1..10] of char;
    var x, y, count: integer;
  
  begin
  
    x:= 0;
    y:= 0;
    number := 0;
    min := 5;
    extra := 5;
    SETLENGTH( machine, min );
    SETLENGTH( product, min );
    SETLENGTH( quality, min );
    writeln('Input Machine ID ( A, B, C, D, E, F or G ) ');
    readln(machine[number] );
    while (machine[number] &lt;&gt; '*') do
    begin
      while ( ORD( machine[number] ) &lt; 65 ) or ( ORD( machine[number] ) &gt; 71 ) do
      begin
        writeln('Input Invalid. Please try again.');
        readln(machine[number] );
      end;
      writeln('Input Product Number ( 0, 1, 2, 3, 4, 5, 6, 7, 8 or 9 ) ');
      readln(product[number] );
      while ( product[number] &lt; 0 ) or ( product[number] &gt; 9 ) do
      begin
        writeln('Input Invalid. Please try again.');
        readln(product[number] );
      end;
      writeln('Quality Control Check. Input 0 for GOOD or 1 for BAD.');
      readln(quality[number] );
      while ( quality[number] &lt;&gt; 0 ) and ( quality[number] &lt;&gt; 1 ) do
      begin
        writeln('Input Invalid. Please try again.');
        readln(quality[number] );
      end;
      number := number + 1;
      writeln('Input Machine ID ( A, B, C, D, E, F or G ) ');
      readln(machine[number] );
    end;
    for count := 0 to number - 1 do
        begin
          writeln('Machine ID = ',machine[count] );
          writeln('Product ID = ',product[count] );
          writeln('Quality = ',quality[count] );
        end;
    writeln('');
    writeln('');
    writeln('EXIT');
    readln;
  end. 
  </code></pre>
  
  <p>Could anyone tell me even how I would go about it? I'm completely at a loss.   </p>