public class ejercicio3 extends javax.swing.JFrame {
/** Creates new form ejercicio3 */
public ejercicio3() {
initComponents();
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { /** Creates new form ejercicio3 */
public ejercicio3() {
initComponents();
}
// TODO add your handling code here:
double base, a1, a2, a3;
base =Double.parseDouble(jtxtse.getText());
double precio_total;
precio_total=base;
if (ttbtna1.isSelected()){
precio_total=precio_total+(base*0.04);
}
if (ttbtna2.isSelected()){
precio_total=precio_total+(base*0.07);
}
if (ttbtnd1.isSelected()){
precio_total=precio_total-120;
}
jtxttn.setText("S/."+precio_total);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new ejercicio3().setVisible(true);
}
});
}
No hay comentarios:
Publicar un comentario