import javax.swing.*;

public class Pvap
{
public static double Pvp(double T)
{double a[]={-7.76451,1.45838,-2.7758,-1.23303};
double w=0.344;
double Tc=647.3;
double Pc=221.2;
double x=1.0-T/Tc;
double pp=1.0/(1-x)*(a[0]*x+a[1]*Math.pow(x,1.5)+a[2]*x*x*x+a[3]*x*x*x*x*x*x);
pp=Pc*Math.exp(pp);
return pp;
}

public static double hfg_CK(double T)
{//Carruth ve Kobayaski
double Tc=647.3;
double Tr=T/Tc;
double w=0.344;
double R=8.3145/18.015;
double pp=7.08*Math.pow((1-Tr),0.354)+10.95*w*Math.pow((1-Tr),0.456);
return pp*R*Tc;
}

public static double hfg_TS(double T)
{//
double Tc=647.3;
double Tr=T/Tc;
double w=0.344;
double wr1=0.21;
double wr2=0.46;
double R=8.3145/18.015;
double x=1-Tr;
double pp1=6.537*Math.pow(x,(1.0/3.0))-2.467*Math.pow(x,(5.0/6.0))-77.521*Math.pow(x,1.208)+
59.634*x+36.009*x*x-14.606*x*x*x;
double pp2=-0.0133*Math.pow(x,(1.0/3.0))-28.215*Math.pow(x,(5.0/6.0))-82.958*Math.pow(x,1.208)+
99.0*x+19.105*x*x-2.796*x*x*x;
double dh2=R*Tc*(pp1+(w-wr1)/(wr2-wr1)*pp2);
return dh2;
}

 public static void main(String args[])
   {double T=Double.parseDouble(JOptionPane.showInputDialog("T = "));
   JOptionPane.showMessageDialog(null,"T = "+T+"Pv = "+Pvp(T)+"hfg = "+hfg_TS(T), "su buharı kaynama basıncı",JOptionPane.PLAIN_MESSAGE);
   }

}