I am using this if statement to formulate some sort of output however only the last block executes where each if is suppose to execute depending on the gross pay that will determine the tax.
It reading input using fstream from a .txt file It reading the right numbers
The if statement is working correctly so its screwing up my output
{
if (gross1, gross2, gross3, gross4, gross5 < THREE_HUNDRED){
tax = TAX1;
taxdeduct = (tax /100);
taxamount = gross1*taxdeduct, taxamount = gross2*taxdeduct, taxamount = gross3*taxdeduct, taxamount = gross4*taxdeduct, taxamount = gross5*taxdeduct;
net1 = gross1-taxamount, net2 = gross2-taxamount, net3 = gross3-taxamount, net4 = gross4-taxamount, net5 = gross5-taxamount;
cout<<fixed<<showpoint;
cout<<setprecision(2);
cout<<hours1<<setw(12)<<rates1<<setw(11)<< gross1<<setw(6)<<tax<<setw(12)<<net1<<endl;
cout<<hours2<<setw(12)<<rates2<<setw(11)<<gross2<<setw(6)<<tax<<setw(12)<<net2<<endl;
cout<<hours3<<setw(12)<<rates3<<setw(11)<<gross3<<setw(6)<<tax<<setw(12)<<net3<<endl;;
cout<<hours4<<setw(12)<<rates4<<setw(11)<<gross4<<setw(6)<<tax<<setw(12)<<net4<<endl;
cout<<hours5<<setw(12)<<rates5<<setw(11)<<gross5<<setw(6)<<tax<<setw(12)<<net5<<endl;
}
if (gross1, gross2, gross3, gross4, gross5 >= THREE_HUNDRED && gross1, gross2, gross3, gross4, gross5 < FOUR_HUNDRED){
tax = TAX2;
taxdeduct = (tax /100);
taxamount = gross1*taxdeduct, taxamount = gross2*taxdeduct, taxamount = gross3*taxdeduct, taxamount = gross4*taxdeduct, taxamount = gross5*taxdeduct;
net1 = gross1-taxamount, net2 = gross2-taxamount, net3 = gross3-taxamount, net4 = gross4-taxamount, net5 = gross5-taxamount;
cout<<fixed<<showpoint;
cout<<setprecision(2);
cout<<hours1<<setw(12)<<rates1<<setw(11)<< gross1<<setw(6)<<tax<<setw(12)<<net1<<endl;
cout<<hours2<<setw(12)<<rates2<<setw(11)<<gross2<<setw(6)<<tax<<setw(12)<<net2<<endl;
cout<<hours3<<setw(12)<<rates3<<setw(11)<<gross3<<setw(6)<<tax<<setw(12)<<net3<<endl;;
cout<<hours4<<setw(12)<<rates4<<setw(11)<<gross4<<setw(6)<<tax<<setw(12)<<net4<<endl;
cout<<hours5<<setw(12)<<rates5<<setw(11)<<gross5<<setw(6)<<tax<<setw(12)<<net5<<endl;
}
if (gross1, gross2, gross3, gross4, gross5 >= FOUR_HUNDRED){
tax = TAX3;
taxdeduct = (tax /100);
taxamount = gross1*taxdeduct, taxamount = gross2*taxdeduct, taxamount = gross3*taxdeduct, taxamount = gross4*taxdeduct, taxamount = gross5*taxdeduct;
net1 = gross1-taxamount, net2 = gross2-taxamount, net3 = gross3-taxamount, net4 = gross4-taxamount, net5 = gross5-taxamount;
cout<<fixed<<showpoint;
cout<<setprecision(2);
cout<<hours1<<setw(12)<<rates1<<setw(11)<< gross1<<setw(6)<<tax<<setw(12)<<net1<<endl;
cout<<hours2<<setw(12)<<rates2<<setw(11)<<gross2<<setw(6)<<tax<<setw(12)<<net2<<endl;
cout<<hours3<<setw(12)<<rates3<<setw(11)<<gross3<<setw(6)<<tax<<setw(12)<<net3<<endl;;
cout<<hours4<<setw(12)<<rates4<<setw(11)<<gross4<<setw(6)<<tax<<setw(12)<<net4<<endl;
cout<<hours5<<setw(12)<<rates5<<setw(11)<<gross5<<setw(6)<<tax<<setw(12)<<net5<<endl;
}
}