jueves, 10 de marzo de 2011

Manejo de cadenas

PARTE LOGICA:



/*
 *2 marzo 2011
 */
package Logica;


/**
 *
 * @author Administrador
 */
public class Proceso {
    private String cad;
    public String getCad() {
        return cad;
    }


    public void setCad(String cad) {
        this.cad = cad;
    }


    public Proceso() {
        cad=null;
    }


 public int hallarPalabras()
 {
    int aux=1;
       int tam=cad.length();
       if(cad==null)
           aux=0;
       else
           for(int i=0; i<tam; i++)
              if(cad.charAt(i)== ' '&& cad.charAt(i-1)!= ' '&& cad.charAt(i+1)!= ' '&& i+1<tam && i-1>=0)
                 aux+=1;
       return aux;
 }

   public String imprimirSE()
   {
       String aux="";
       int tam=cad.length();
       for(int i=0; i<tam; i++)
           if(cad.charAt(i)!= ' ')
              aux+=cad.charAt(i);
       return aux;


   }
  public String imprimirSV()
  {
   String aux="";
       int tam=cad.length();
       for(int i=0; i<tam; i++)
       { if(cad.charAt(i)== 'a'||cad.charAt(i)== 'A'||
              cad.charAt(i)== 'e'||cad.charAt(i)== 'E'||
              cad.charAt(i)== 'i'||cad.charAt(i)== 'I'||
              cad.charAt(i)== 'o'||cad.charAt(i)== 'O'||
              cad.charAt(i)== 'u'||cad.charAt(i)== 'U')
              aux+=' ';
           else
               aux+=cad.charAt(i);
       }
       return aux;


  }
   public String imprimirSL()
  {
   String aux="";
       int tam=cad.length();
       for(int i=0; i<tam; i++)
       { if(cad.charAt(i)== 'a'||cad.charAt(i)== 'A'||
              cad.charAt(i)== 'e'||cad.charAt(i)== 'E'||
              cad.charAt(i)== 'i'||cad.charAt(i)== 'I'||
              cad.charAt(i)== 'o'||cad.charAt(i)== 'O'||
              cad.charAt(i)== 'u'||cad.charAt(i)== 'U')
              aux+=cad.charAt(i);
           else
               aux+=' ';
       }
       return aux;


  }


   public String imprimirSLV()
  {
   String aux="";
       int tam=cad.length();
       for(int i=0; i<tam; i++)
       {if((cad.charAt(i)>=65 &&cad.charAt(i)<=90)||(cad.charAt(i)>=97 &&cad.charAt(i)<=122))
              aux+=' ';
           else
               aux+=cad.charAt(i);
       }
       return aux;


  }
   public String pegarcad(String cad2)
    {
         
       int tam=cad2.length();
       for(int i=0; i<tam; i++)
       {
          cad+= cad2.charAt(i);
       }
      return cad;
    }








}


PARTE DE PRESENTACION:


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


/*
 * Formulario.java
 *
 * Created on 7/03/2011, 07:30:02 PM
 */


package Ilustrar;
import Logica.Proceso;
import javax.swing.JOptionPane;


/**
 *
 * @author Administrador
 */
public class Formulario extends java.applet.Applet {


    /** Initializes the applet Formulario */
    public void init() {
        try {
            java.awt.EventQueue.invokeAndWait(new Runnable() {
                public void run() {
                    initComponents();
                }
            });
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }


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


        jLabel1 = new javax.swing.JLabel();
        TEXTO1 = new javax.swing.JLabel();
        ESCRITO1 = new javax.swing.JTextField();
        ESCRITO2 = new javax.swing.JTextField();
        BOTON1 = new javax.swing.JButton();
        BOTON2 = new javax.swing.JButton();
        BONTON3 = new javax.swing.JButton();
        ESCRITO3 = new javax.swing.JTextField();
        TEXTO2 = new javax.swing.JLabel();
        boton4 = new javax.swing.JButton();
        BONTON5 = new javax.swing.JButton();
        BONTON6 = new javax.swing.JButton();
        BOTON7 = new javax.swing.JButton();
        BOTON8 = new javax.swing.JButton();


        setBackground(new java.awt.Color(255, 255, 153));


        jLabel1.setText("Programa para el manejo de caracteres");


        TEXTO1.setText("Digite dos cadenas");


        ESCRITO1.setBackground(new java.awt.Color(0, 255, 255));


        ESCRITO2.setBackground(new java.awt.Color(0, 255, 255));
        ESCRITO2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                ESCRITO2ActionPerformed(evt);
            }
        });


        BOTON1.setText("imprimir cadena1");
        BOTON1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BOTON1ActionPerformed(evt);
            }
        });


        BOTON2.setText("imprimir cadena 2");
        BOTON2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BOTON2ActionPerformed(evt);
            }
        });


        BONTON3.setText("mostrar cadenas unidas");
        BONTON3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BONTON3ActionPerformed(evt);
            }
        });


        ESCRITO3.setBackground(new java.awt.Color(102, 255, 255));


        TEXTO2.setBackground(new java.awt.Color(0, 255, 255));
        TEXTO2.setText("digite texto");


        boton4.setBackground(new java.awt.Color(255, 255, 255));
        boton4.setText("Hallar cantidad de palabras");
        boton4.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                boton4ActionPerformed(evt);
            }
        });


        BONTON5.setText("monstrar frase sin espacios");
        BONTON5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BONTON5ActionPerformed(evt);
            }
        });


        BONTON6.setText("mostrar sin vocales");
        BONTON6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BONTON6ActionPerformed(evt);
            }
        });


        BOTON7.setText("Mostrar sin letras");
        BOTON7.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BOTON7ActionPerformed(evt);
            }
        });


        BOTON8.setText("Mostrar sin letras ni vocales");
        BOTON8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                BOTON8ActionPerformed(evt);
            }
        });


        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(206, 206, 206)
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 219, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(67, 67, 67)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addComponent(TEXTO1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 168, Short.MAX_VALUE))
                            .addComponent(ESCRITO1, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE)
                            .addComponent(ESCRITO2, javax.swing.GroupLayout.DEFAULT_SIZE, 258, Short.MAX_VALUE))
                        .addGap(36, 36, 36)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(BOTON2, javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(BOTON1, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addGap(47, 47, 47)
                        .addComponent(BONTON3)
                        .addGap(630, 630, 630))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(layout.createSequentialGroup()
                                .addGap(55, 55, 55)
                                .addComponent(TEXTO2, javax.swing.GroupLayout.DEFAULT_SIZE, 967, Short.MAX_VALUE)
                                .addGap(205, 205, 205))
                            .addGroup(layout.createSequentialGroup()
                                .addGap(72, 72, 72)
                                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(BONTON6)
                                        .addGap(35, 35, 35)
                                        .addComponent(BOTON7))
                                    .addGroup(layout.createSequentialGroup()
                                        .addComponent(ESCRITO3, javax.swing.GroupLayout.PREFERRED_SIZE, 268, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addGap(36, 36, 36)
                                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                            .addComponent(BONTON5)
                                            .addComponent(boton4))))))
                        .addGap(73, 73, 73))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(161, 161, 161)
                        .addComponent(BOTON8)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(21, 21, 21)
                        .addComponent(jLabel1)
                        .addGap(38, 38, 38)
                        .addComponent(TEXTO1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ESCRITO1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(BOTON1))
                        .addGap(18, 18, 18)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(ESCRITO2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(BOTON2))
                        .addGap(35, 35, 35))
                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                        .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(BONTON3)
                        .addGap(62, 62, 62)))
                .addComponent(TEXTO2, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(boton4)
                        .addGap(18, 18, 18)
                        .addComponent(BONTON5))
                    .addComponent(ESCRITO3, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(BONTON6)
                    .addComponent(BOTON7))
                .addGap(18, 18, 18)
                .addComponent(BOTON8)
                .addContainerGap(111, Short.MAX_VALUE))
        );
    }// </editor-fold>


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


    private void BOTON1ActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
      Proceso obj1=new Proceso();


     obj1.setCad(ESCRITO1.getText());


     JOptionPane.showMessageDialog(null, obj1.getCad());
    }                                      


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


     Proceso obj2=new Proceso();


     obj2.setCad(ESCRITO2.getText());
     JOptionPane.showMessageDialog(null, obj2.getCad());
    }                                      


    private void BONTON3ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
          Proceso obj1=new Proceso();
     Proceso obj2=new Proceso();
     obj1.setCad(ESCRITO1.getText());
     obj2.setCad(ESCRITO2.getText());
     JOptionPane.showMessageDialog(null, obj1.pegarcad(obj2.getCad()));
    }                                       


    private void boton4ActionPerformed(java.awt.event.ActionEvent evt) {                                       
        // TODO add your handling code here:
         Proceso obj1=new Proceso();
        obj1.setCad(ESCRITO3.getText());
        JOptionPane.showMessageDialog(null,"LA FRASE: "+obj1.getCad()+"\n tiene "+ obj1.hallarPalabras()+" palabras");
    }                                      


    private void BONTON5ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        Proceso obj1=new Proceso ();
        obj1.setCad(ESCRITO3.getText());
        JOptionPane.showMessageDialog(null,obj1.imprimirSE());
    }                                       


    private void BONTON6ActionPerformed(java.awt.event.ActionEvent evt) {                                        
        // TODO add your handling code here:
        Proceso obj1=new Proceso();
        obj1.setCad(ESCRITO3.getText());
        JOptionPane.showMessageDialog(null,obj1.imprimirSV());
    }                                       


    private void BOTON7ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
        Proceso obj= new Proceso ();
        obj.setCad(ESCRITO3.getText());
        JOptionPane.showMessageDialog(null,obj.imprimirSL());


    }


    private void BOTON8ActionPerformed(java.awt.event.ActionEvent evt) {
        // TODO add your handling code here:
         Proceso obj= new Proceso ();
        obj.setCad(ESCRITO3.getText());
        JOptionPane.showMessageDialog(null,obj.imprimirSLV());
    }




    // Variables declaration - do not modify
    private javax.swing.JButton BONTON3;
    private javax.swing.JButton BONTON5;
    private javax.swing.JButton BONTON6;
    private javax.swing.JButton BOTON1;
    private javax.swing.JButton BOTON2;
    private javax.swing.JButton BOTON7;
    private javax.swing.JButton BOTON8;
    private javax.swing.JTextField ESCRITO1;
    private javax.swing.JTextField ESCRITO2;
    private javax.swing.JTextField ESCRITO3;
    private javax.swing.JLabel TEXTO1;
    private javax.swing.JLabel TEXTO2;
    private javax.swing.JButton boton4;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration


}



miércoles, 2 de marzo de 2011

notas estudiantes con array de objetos

PARTE LOGICA:



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


package Logica;
import java.lang.*;
import javax.swing.JOptionPane;
/* *
 * @author microsoft
 */
public class Estudiante {


    double not1, not2,not3, porc1, porc2, porc3;


    public Estudiante(double not1, double not2, double not3, double porc1, double porc2, double porc3) {
        this.not1 = not1;
        this.not2 = not2;
        this.not3 = not3;
        this.porc1 = porc1;
        this.porc2 = porc2;
        this.porc3 = porc3;
    }




    public double getNot1() {
        return not1;
    }


    public void setNot1(double not1) {
        this.not1 = not1;
    }


    public double getNot2() {
        return not2;
    }


    public void setNot2(double not2) {
        this.not2 = not2;
    }


    public double getNot3() {
        return not3;
    }


    public void setNot3(double not3) {
        this.not3 = not3;
    }


    public double getPorc1() {
        return porc1;
    }


    public void setPorc1(double porc1) {
        this.porc1 = porc1;
    }


    public double getPorc2() {
        return porc2;
    }


    public void setPorc2(double porc2) {
        this.porc2 = porc2;
    }


    public double getPorc3() {
        return porc3;
    }


    public void setPorc3(double porc3) {
        this.porc3 = porc3;
    }


    public double calculardef ()
    {
       double sum = ( (getNot1()*getPorc1())/100)+((getNot2()*getPorc2())/100)+((getNot3()*getPorc3())/100);
       double def = sum/3;
       def=arrastrarnota(def);
       return def;
    }


    public double arrastrarnota (double nota)
    {
      if(nota<1.75)
          nota=1.5;
      else if(nota>=1.75 && nota<2.25)
               nota=2.0;
          else if(nota>=2.25 && nota<2.75)
                    nota=2.5;
               else if(nota>=2.75 && nota<3.25)
                    nota=3.0;
                    else if(nota>=3.75 && nota<3.75)
                          nota=3.5;
                          else if(nota>=3.75 && nota<4.25)
                                nota=4.0;
                               else if(nota>=4.25 && nota<4.65)
                                     nota=4.5;
                                    else
                                        nota=5.0;
      return nota;
    }
}

PARTE DE PRESENTACION:

/*
 * presentcion de las notas
 */

package Presentacion;
import java.lang.*;
import javax.swing.JOptionPane;
import Logica.Estudiante;
/**
 *
 * jesus suarez
 * david loaiza
 * 22 feb 2011
 */
public class Formulario {

    public static void main(String args [])
    {
        double totalponderado =100.0;
        int numestudiante=Integer.parseInt(JOptionPane.showInputDialog("Digite el número de estudiantes."));
        Estudiante obj[]=new Estudiante [numestudiante];

        for(int j=0; j< numestudiante;j++)
        {
           obj[j]=new Estudiante(0.0,0.0,0.0,0.0,0.0,0.0);
        }
        for(int i=0, j=1; i< numestudiante;j++,i++)
        {

            //digite porcentajes yu compruba que no sobrepacen 100
           JOptionPane.showMessageDialog(null,"digite porcentajes de estudiante # "+j );

           do{
             obj[i].setPorc1(Double.parseDouble(JOptionPane.showInputDialog(null," Digite porcentaje 1 de 3:")));
           }while (obj[i].getPorc1()>totalponderado && obj[i].getPorc1()>=0);
           totalponderado-=obj[i].getPorc1();
           do{
             obj[i].setPorc2(Double.parseDouble(JOptionPane.showInputDialog(null,"Digite porcentaje 2 de 3:")));
           }while (obj[i].getPorc2()>totalponderado && obj[i].getPorc2()>=0);
           totalponderado-=obj[i].getPorc2();
           do{
             obj[i].setPorc3(Double.parseDouble(JOptionPane.showInputDialog(null,"Digite porcentaje 3 de 3:")));
           }while (obj[i].getPorc3()>totalponderado && obj[i].getPorc3()>=0);
           totalponderado-=obj[i].getPorc3();
           totalponderado=100.0;

           // realiza la escritura de las ntoas con sus respectivas restricciones
            JOptionPane.showMessageDialog(null,"digite notas de estudiante # "+j );
            do
            {
              obj[i].setNot1(Double.parseDouble(JOptionPane.showInputDialog(null,"digite nota 1 de 3 :")));
            }while(obj[i].getNot1()<0.0 || obj[i].getNot1()>5.0);
             do
            {
              obj[i].setNot2(Double.parseDouble(JOptionPane.showInputDialog(null,"digite nota 2 de 3 :")));
            }while(obj[i].getNot2()<0.0||obj[i].getNot2()>5.0);
              do
            {
              obj[i].setNot3(Double.parseDouble(JOptionPane.showInputDialog(null,"digite nota 3 de 3 :")));
            }while(obj[i].getNot3()<0.0||obj[i].getNot3()>5.0);

        }

        //impresion de los datos
        for(int i=0, j=1; i< numestudiante;j++,i++)
        {
          JOptionPane.showMessageDialog(null, "\nnotas del estudiante #"  +j+ " \nnota 1 = "+obj[i].getNot1()+ " porcentaje = "+obj[i].getPorc1()+"\n nota 2 = "+obj[i].getNot2()+ " porcentaje = "+obj[i].getPorc2()+"\nnota 3 = "+obj[i].getNot3()+ " porcentaje = "+obj[i].getPorc3()+ "\n definitiva del estudiante : "+ obj[i].calculardef() );
          if(obj[i].calculardef()>=3.0)
              JOptionPane.showMessageDialog(null,"aprobo");
          else
               JOptionPane.showMessageDialog(null, "reprobo");
        }   
        
        }
    
}

lunes, 28 de febrero de 2011

numero capicua

parte logica:

/*
 * logica apra averiguar si un numero es apicua
 */


package Logica;
import javax.swing.*;
/**
 *
 * Jesus Ernesto Suarez Triana
 * cod: 20101078100
 */
public class Capicua {
    private int dato;
    public Capicua(){
     dato=0;
    }
    public void setdato(int dato){
    this.dato=dato;
    }
    public int getdato(){
    return dato;
    }
    public String verificarcapicua()
    {


        String cad1=dato+"";
        String cad2="";


        int tam= cad1.length();
        for(int i=tam-1; i>=0;i--)
            cad2+=cad1.charAt(i);
               JOptionPane.showMessageDialog(null,cad1+"*"+cad2);


     for(int i=0;i<tam ; i++)
               {
                if(cad1.charAt(i)!=cad2.charAt(i))
                    return "el numero no es capicua";
                 }
     
           return ("el numero es apicua");
     


    }


}


parte presentacion:


/* numero apicua*/


package Presentacion;
import Logica.Capicua;
import java.lang.*;
import javax.swing.JOptionPane;
/**
 *
 * Jesus Ernesto Suarez Triana
 * cod: 20101078100
 */
public class Ilustracion {




    public static void main ( String arg [])
    {
       Capicua obj=new Capicua ();
       JOptionPane.showMessageDialog(null, "PROGRAMA QUE VERIFICA NUMEROS ENTEROS CAPICUAS");
      obj.setdato( Integer.parseInt(JOptionPane.showInputDialog(null,"digite un numero, recuerde que debe ser entero")));
       JOptionPane.showMessageDialog(null," el numero es : "+ obj.getdato());
       JOptionPane.showMessageDialog(null,obj.verificarcapicua());


    }
}

metodo de la burbuja

PARTE LOGICA

/*
 * logica de la burbuja de 10 numeros
 */

package Logica;
import javax.swing.JOptionPane;
import java.lang.*;

/**
 *
 * Jesus ernesto suarez triana
 * 28 feb 2011
 */
public class Proceso {

   public   Proceso(int cad [],int tam )
     {
        for(int i=0; i<tam;i++)
        {
          cad[i]=Integer.parseInt(JOptionPane.showInputDialog(null ,"digite numero # "+ i));
        }
     }
     public  int[] ordenar (int cad[], int tam)
     {
         int aux;
         for(int i=0; i<tam;i++)
             for(int j=i; j<tam;j++)
                 if(cad[j]<cad[i])
                 {
                    aux=cad[j];
                    cad[j]=cad[i];
                    cad[i]=aux;
                 }
         return cad;
     }
}



parte de presentación:

/*
 * Presentacin del metodo de la burbuja
 */

package presentacion;
import Logica.Proceso;
import java.lang.*;

import javax.swing.JOptionPane;

/**
 *Jesus ernesto suarez triana
 * 28 feb 2011
 * @author Administrador
 */
public class Formulario {

    public static void main (String arg[])
    {
        int tam=10;

        JOptionPane.showMessageDialog(null,"Programa de burbuja de 10 numeros enteros" );
       int cadena []=new int [tam];
       Proceso obj=new Proceso(cadena, tam);
       cadena=obj.ordenar(cadena, tam);


       JOptionPane.showMessageDialog(null,"el numero menor es : " + cadena[0]);
       JOptionPane.showMessageDialog(null,"el numero mayor es : " + cadena[9]);

       JOptionPane.showMessageDialog(null,"impresion arreglo");
       for(int i=0; i<tam;i++)
       {
         JOptionPane.showMessageDialog(null,cadena[i]);
       }


    }