Programacion
Programacion
//Entrada
String prod=txtproducto.getText();
int cant=Integer.parseInt(txtcantidad.getText());
double prec=Double.parseDouble(txtprecio.getText());
double total=0.0;
//Proceso
total=((cant*prec)+(cant*prec*0.18));
//salida
txtatotal.setText("Tambo: ");
txtproducto.setText("");
txtcantidad.setText("");
txtprecio.setText("");
txtatotal.setText("");
txtproducto.requestFocus();
2)
String nom=txtNOMBRE.getText();
double APF1=Double.parseDouble(txtAPF1.getText());
double APF2=Double.parseDouble(txtAPF2.getText());
double APF3=Double.parseDouble(txtAPF3.getText());
double TA1=Double.parseDouble(txtTA1.getText());
double TA2=Double.parseDouble(txtTA2.getText());
double PROY=Double.parseDouble(txtPROY.getText());
double total=0.0;
total=(APF1*0.10)+(APF2*0.20)+(APF3*0.20)+(TA1*0.10)+(TA2*0.10)+(PROY*0.30);
txtaRESULTADO.append("\n");
txtNOMBRE.setText("");
txtAPF1.setText("");
txtAPF2.setText("");
txtAPF3.setText("");
txtTA1.setText("");
txtTA2.setText("");
txtPROY.setText("");
txtaRESULTADO.setText("");
txtNOMBRE.requestFocus();