double a, b, c, d, e, f, g, h, i, j, k, l, x;
double k1, k2, k3, k4, k7, k8, bobot1 = 0, bobot2 = 0, bobot3 = 0, bobot4 = 0, bobot7 = 0, bobot8 = 0;
double hasil;
a=Double.parseDouble(K1.getText());
b=Double.parseDouble(K2.getText());
c=Double.parseDouble(K3.getText());
d=Double.parseDouble(K4.getText());
e=Double.parseDouble(K7.getText());
f=Double.parseDouble(K8.getText());
String sql="select * from kriteria where id_kriteria='k1'";
stat=con.createStatement();
res=stat.executeQuery(sql);
while(res.next()){
bobot1= Double.parseDouble(res.getString("bobotWP"));
}
sql = "select * from kriteria where id_kriteria='k2'";
res=stat.executeQuery(sql);
while(res.next()){
bobot2= Double.parseDouble(res.getString("bobotWP"));
}
sql="select * from kriteria where id_kriteria='k3'";
stat=con.createStatement();
res=stat.executeQuery(sql);
while(res.next()){
bobot3= Double.parseDouble(res.getString("bobotWP"));
}
sql="select * from kriteria where id_kriteria='k4'";
stat=con.createStatement();
res=stat.executeQuery(sql);
while(res.next()){
bobot4= Double.parseDouble(res.getString("bobotWP"));
}
sql="select * from kriteria where id_kriteria='k7'";
stat=con.createStatement();
res=stat.executeQuery(sql);
while(res.next()){
bobot7= Double.parseDouble(res.getString("bobotWP"));
}
sql="select * from kriteria where id_kriteria='k8'";
stat=con.createStatement();
res=stat.executeQuery(sql);
while(res.next()){
bobot8= Double.parseDouble(res.getString("bobotWP"));
}
k1 = (double) (Math.pow(a, bobot1));
k2 = (double) (Math.pow(b, bobot2));
k3 = (double) (Math.pow(c, bobot3));
k4 = (double) (Math.pow(d, bobot4));
k7 = (double) (Math.pow(e, bobot7));
k8 = (double) (Math.pow(f, bobot8));
hasil= (double) (k1*k2*k3*k4*k7*k8);
nilai.setText(String.valueOf(hasil));