viernes, 24 de agosto de 2012

       
3 PROGRAMA EN CLASES : CONDICIONAL IF 


1. Comprimido del Programa

 Condiciones (if)


2. Código Fuente en NetBeans (Para determinar si un numero es mayor de diez)

private void jBtnenviarActionPerformed(java.awt.event.ActionEvent evt) {

    Integer num=0;// Definimos una variable de tipo entero
    num=Integer.parseInt(jTxtnumero.getText()); // Convierto de letras a numeros
    if(num>10)// CONDICION
    {//INICIO
    JOptionPane.showMessageDialog(null, "EL NUMERO ES MAYOR DE 10" );// PANEL DE DIALOGO
    }//FIN
    else//SI NO (En caso de que la condicion sea falsa)
    {//INICIO
    JOptionPane.showMessageDialog( null, " ERROR EL NUMERO ES MENOR DE 10");  
    }//FIN
        
      // TODO add your handling code here:
    }

PROGRAMAS EN CLASES 

1. Codigo Fuente "Hola Mundo" ( NetBeans)

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package paqHolaMundo;

import javax.swing.JOptionPane;

/**
 *
 * @author moises
 */
public class jHolaMundo extends javax.swing.JFrame {

    /**
     * Creates new form jHolaMundo
     */
    public jHolaMundo() {
        initComponents();
        JOptionPane.showMessageDialog(null,"Bienvenido");
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {

        jLblNombre = new javax.swing.JLabel();
        jTxtNombre = new javax.swing.JTextField();
        jBtnEnviar = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLblNombre.setText("Ingrese su nombre: ");

        jBtnEnviar.setText("Enviar");
        jBtnEnviar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnEnviarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jTxtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
                        .addGap(80, 80, 80)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jBtnEnviar)
                            .addComponent(jLblNombre))))
                .addContainerGap(360, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(72, 72, 72)
                .addComponent(jLblNombre)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jTxtNombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(26, 26, 26)
                .addComponent(jBtnEnviar)
                .addContainerGap(252, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>                        

    private void jBtnEnviarActionPerformed(java.awt.event.ActionEvent evt) {                                           
String nombre;
nombre=jTxtNombre.getText();
        JOptionPane.showMessageDialog(null, "Hola "+nombre); 
jBtnEnviar.setText("Hola Mundo");// TODO add your handling code here:
    }                                          

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(jHolaMundo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(jHolaMundo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(jHolaMundo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(jHolaMundo.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jHolaMundo().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify                     
    private javax.swing.JButton jBtnEnviar;
    private javax.swing.JLabel jLblNombre;
    private javax.swing.JTextField jTxtNombre;
    // End of variables declaration                   
}


COMPRIMIDO DEL PROGRAMA "HOLA MUNDO"




2. Código Fuente de  Operación con Sumas ( Netbeans)

package paqSuma;

/**
 *
 * @author moises
 */
public class jSuma extends javax.swing.JFrame {

    /**
     * Creates new form jSuma
     */
    public jSuma() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jTxtNumUno = new javax.swing.JTextField();
        jTxtNumDos = new javax.swing.JTextField();
        jBtnSumar = new javax.swing.JButton();
        jLblResultado = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jBtnSumar.setText("Sumar");
        jBtnSumar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnSumarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(83, 83, 83)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jTxtNumUno, javax.swing.GroupLayout.PREFERRED_SIZE, 83, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(27, 27, 27)
                        .addComponent(jTxtNumDos, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jLblResultado, javax.swing.GroupLayout.PREFERRED_SIZE, 53, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addComponent(jBtnSumar)))
                .addContainerGap(134, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(96, 96, 96)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTxtNumUno, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTxtNumDos, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addComponent(jBtnSumar)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLblResultado, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(111, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>

    private void jBtnSumarActionPerformed(java.awt.event.ActionEvent evt) {                                        
Integer num1,num2;
num1=Integer.parseInt(jTxtNumUno.getText());
num2=Integer.parseInt(jTxtNumDos.getText());
Integer resultado;
resultado=num1+num2;
jLblResultado.setText(resultado.toString());

// TODO add your handling code here:
    }                                        

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(jSuma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(jSuma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(jSuma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(jSuma.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jSuma().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JButton jBtnSumar;
    private javax.swing.JLabel jLblResultado;
    private javax.swing.JTextField jTxtNumDos;
    private javax.swing.JTextField jTxtNumUno;
    // End of variables declaration
}


COMPRIMIDO DEL PROGRAMA DE OPERACIONES CON SUMA




1. TALLER PROGRAMACIÓN : 
PROGRAMA DE OPERACIONES BÁSICAS


1. Código Fuente ( NetBeans)

package paqfunbas;

/**
 *
 * @author FAMILIA ARIZA
 */
public class jfunbas extends javax.swing.JFrame {

    /**
     * Creates new form jfunbas
     */
    public jfunbas() {
        initComponents();
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jbtnsum = new javax.swing.JButton();
        jbtnres = new javax.swing.JButton();
        jbtnmult = new javax.swing.JButton();
        jbtndiv = new javax.swing.JButton();
        jlblresultadosum = new javax.swing.JLabel();
        jtxtfunbas2 = new javax.swing.JTextField();
        jtxtfunbas1 = new javax.swing.JTextField();
        jlblresultadorest = new javax.swing.JLabel();
        jlblresultadomult = new javax.swing.JLabel();
        jlblresultadodiv = new javax.swing.JLabel();
        jlbltitulo = new javax.swing.JLabel();

        jLabel1.setText("jLabel1");

        jLabel2.setText("jLabel2");

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jbtnsum.setText("SUMAR");
        jbtnsum.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnsumActionPerformed(evt);
            }
        });

        jbtnres.setText("RESTAR");
        jbtnres.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnresActionPerformed(evt);
            }
        });

        jbtnmult.setText("MULTIPLICAR");
        jbtnmult.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtnmultActionPerformed(evt);
            }
        });

        jbtndiv.setText("DIVIDIR");
        jbtndiv.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtndivActionPerformed(evt);
            }
        });

        jlblresultadosum.setText("Resultado Suma");

        jtxtfunbas1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtxtfunbas1ActionPerformed(evt);
            }
        });

        jlblresultadorest.setText("Resultado Resta");

        jlblresultadomult.setText("Resultado Multiplicación");

        jlblresultadodiv.setText("Resultado Division");

        jlbltitulo.setText("CALCULADORA DE OPERACIONES BASICAS");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jtxtfunbas2, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtxtfunbas1, javax.swing.GroupLayout.PREFERRED_SIZE, 72, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jbtnmult)
                    .addComponent(jbtndiv, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jbtnres, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jbtnsum, javax.swing.GroupLayout.PREFERRED_SIZE, 99, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(44, 44, 44)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jlblresultadosum, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jlblresultadomult)
                            .addComponent(jlblresultadorest, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jlblresultadodiv, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(171, Short.MAX_VALUE)
                .addComponent(jlbltitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(129, 129, 129))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlbltitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 27, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jbtnmult)
                            .addComponent(jlblresultadomult, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(35, 35, 35))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jbtnsum)
                            .addComponent(jlblresultadosum, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(37, 37, 37)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jtxtfunbas2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jbtnres)
                            .addComponent(jlblresultadorest, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(18, 18, 18)
                        .addComponent(jtxtfunbas1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(55, 55, 55)))
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jbtndiv)
                    .addComponent(jlblresultadodiv, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(44, 44, 44))
        );

        pack();
    }// </editor-fold>

    private void jbtnsumActionPerformed(java.awt.event.ActionEvent evt) {                                        
Integer num1,num2;
num1=Integer.parseInt(jtxtfunbas1.getText());
num2=Integer.parseInt(jtxtfunbas2.getText());
Integer resultado;
resultado=num1 + num2;
jlblresultadosum.setText(resultado.toString());        // TODO add your handling code here:
    }                                       

    private void jtxtfunbas1ActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
    }                                           

    private void jbtnresActionPerformed(java.awt.event.ActionEvent evt) {                                        
Integer num1,num2;
num1=Integer.parseInt(jtxtfunbas1.getText());
num2=Integer.parseInt(jtxtfunbas2.getText());
Integer resultado;
resultado=num1 - num2;
jlblresultadorest.setText(resultado.toString());     // TODO add your handling code here:
    }                                       

    private void jbtnmultActionPerformed(java.awt.event.ActionEvent evt) {                                         
Integer num1,num2;
num1=Integer.parseInt(jtxtfunbas1.getText());
num2=Integer.parseInt(jtxtfunbas2.getText());
Integer resultado;
resultado=num1 * num2;
jlblresultadomult.setText(resultado.toString());        // TODO add your handling code here:
    }                                        

    private void jbtndivActionPerformed(java.awt.event.ActionEvent evt) {                                        
Integer num1,num2;
num1=Integer.parseInt(jtxtfunbas1.getText());
num2=Integer.parseInt(jtxtfunbas2.getText());
Integer resultado;
resultado=num1 / num2;
jlblresultadodiv.setText(resultado.toString());        // TODO add your handling code here:
    }                                       

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(jfunbas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(jfunbas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(jfunbas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(jfunbas.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new jfunbas().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JButton jbtndiv;
    private javax.swing.JButton jbtnmult;
    private javax.swing.JButton jbtnres;
    private javax.swing.JButton jbtnsum;
    private javax.swing.JLabel jlblresultadodiv;
    private javax.swing.JLabel jlblresultadomult;
    private javax.swing.JLabel jlblresultadorest;
    private javax.swing.JLabel jlblresultadosum;
    private javax.swing.JLabel jlbltitulo;
    private javax.swing.JTextField jtxtfunbas1;
    private javax.swing.JTextField jtxtfunbas2;
    // End of variables declaration
}


2. Comprimido del Programa

sábado, 18 de agosto de 2012

PRIMER TRABAJO PROGRAMACIÓN ESTRUCTURADA

  • PROGRAMA "HOLA MUNDO"

ALGORITMO 
Proceso HOLA_MUNDO
Escribir ""
Escribir "¡¡...HOLA MUNDO...¡¡"
Escribir ""
FinProceso

DIAGRAMA DE FLUJO (DFD)

  • PROGRAMA PARA SUMAR ELEMENTOS

ALGORITMO 
Proceso SUMA
Escribir "**********BIENVENIDO***********" 
Escribir ""
    Escribir 'INGRESE EL PRIMER VALOR A SUMAR: ';
    Leer A;
    Escribir 'INGRESE EL SEGUNDO VALOR A SUMAR: ';
    Leer B;
    SUMA<-A+B;
Escribir ""
    Escribir 'LA SUMA DE ',A,' + ',B,' ES = ',SUMA;
Escribir ""
Escribir "GRACIAS POR UTILIZAR EL PROGRAMA, QUE TENGA UN BUEN DIA :)"
FinProceso

DIAGRAMA DE FLUJO (DFD)