public class reactiontest1
{
public static void main(String arg[])
{
String s[]={"ch4","o2","n2","co2","h2o"};
double N[][]={{1.0,0.0},{2.0,0.0},{7.523809524,7.523809524},{0.0,1.0},{0.0,2.0}};
double Tproduct=1000.0;//degree K
double Treactant=298.16;//degree K
int k=s.length;
Gas g[]=new Gas[k];
for(int i=0;i<k;i++)
{g[i]=new Gas(s[i]);
}
double Qproduct=0;
double Qreactant=0;
for(int i=0;i<k;i++)
{Qproduct+=N[i][1]*g[i].ht(Tproduct);}
for(int i=0;i<k;i++)
{Qreactant+=N[i][0]*g[i].ht(Treactant);}
double Q=Qproduct-Qreactant;
System.out.println("Q="+Q);	
}	
}