Ok so its going through the loop- but its not calculating correctly. I am using redirection for this and my input file looks like this:

123
P 3 M M S <--its not adding all of them together- only the first one....
T 2.5
Q
456
S 5 12 3 10 7 16
R 4
P 1 L
Q


I havent written the other codes yet, just want to find out why my calculations for P arent working. This will read in the job number, then read in a code. If its P, I want it to read in the number of sizes there are going to be. Thats where my for loop comes in. This is whats NOT working. SO then it reads the M, and should add 100, then reads in another M and should add 100 to the 100 already in total1....and on and on. Thanks


Code:
{
  cin >> code;
  while(code!='Q')
    {
        if (code == 'P')
        {
          cin >> num;
          cin >> size;
          for (int i=1; i <= num; i++);
           {
            if (size == 'S')
             {
              total1 = total1 + S;
              sum = sum + S;
             }
            else if (size == 'M')
             {
              total1 = total2 + M;
              sum = sum + M;
             }
            else if (size == 'L')
             {
              total1 = total3 + L;
              sum = sum + L;
             }
           }
        }
        cin >> code;
    }

 cout << setw(7) << jobnum << "$" << right << setw(7) << total1 << "   $" << setw(7) << total2 << "   $" << setw(7) << total3 << "   $" << setw(7) << total4 << "   $" << setw(7)\
 << total1 << endl;

 cin >> jobnum;
 }
 cout <<  "TOTAL" << setw (54) << sum <<  endl;
}