Hey guys. I've been having a bit of a problem writing to an output file. My goal is to have the first if statement run completely for all the data and then later have the second if statement run for all the data. What currently happens is that the first one runs for the first data input, then the second one rusn for the first data input, and then it goes back to the first if statement for the second data input and so on. I have tried everything, break, creating a second while loop, and nothing seems to work. Any tips?
while (fin>>Batchno>>NoPillBottles>>NoMedicineBoxes>>NoSyringeBoxes) \\this is my while loop, getting data from another file
if (resx>minpill1 && resy>minmed1 && resz>minsyr1) // Establish conditions
{
cout<<"Batch number "<<Batchno<<" meets the requirement of minimum objects for a MediVan cart"; //output within program
outfile <<Batchno<<"\t "<<NoPillBottles<< "\t " <<NoMedicineBoxes<< " \t" <<NoSyringeBoxes<<; //write to output file
}
if (resx>minpill2 && resy>minmed2 && resz>minsyr2)
{
cout<<"Batch number "<<Batchno<<" meets the requirement of minimum objects for a RollaMed cart. \n \n \n"; //output within program
outfile <<Batchno<<"\t "<<NoPillBottles<< "\t " <<NoMedicineBoxes<< " \t" <<NoSyringeBoxes<<"\n \n \n"; //write to output file