Programabotonera Parcial2 Arzatemartinez
Programabotonera Parcial2 Arzatemartinez
PORTAFOLIO DE EVIDENCIAS
FUNDAMENTOS DE PROGRAMACION
BOTONERA
Grupo
311-V
2019-1
SISTEMAS OPERATIVOS 2
Algoritmo SUMA
si a>0 Entonces
Escribir ' Dame un numero'
Leer b
si b>0 Entonces
res <- a+b
Escribir 'La suma es ',res
SiNo
Imprimir "Introdujo valores incorrectos"
FinSi
SiNo
Imprimir "Introdujo valores incorrectos"
FinSi
FinAlgoritmo
DIAGRAMA
CODIFICACION
*
* To change this license header, choose License Headers in Project
Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author arzate
*/
public class botones extends javax.swing.JFrame {
/**
* Creates new form botones
*/
public botones() {
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() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
sumar.setText("Sumar");
sumar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
sumarActionPerformed(evt);
}
});
restar.setText("Restar");
restar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
restarActionPerformed(evt);
}
});
limpiar.setText("Limpiar");
limpiar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
limpiarActionPerformed(evt);
}
});
salir.setText("Salir");
salir.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
salirActionPerformed(evt);
}
});
c1.setText(" ");
c1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
c1ActionPerformed(evt);
}
});
c2.setText(" ");
res.setText(" ");
jLabel2.setText("Valor 1");
jLabel3.setText("Valor 2");
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(91, 91, 91))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.LEADING, false)
.addGroup(layout.createSequentialGroup()
.addGap(37, 37, 37)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayo
ut.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3))
.addGap(41, 41, 41)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayo
ut.Alignment.LEADING, false)
.addComponent(c2,
javax.swing.GroupLayout.DEFAULT_SIZE, 139, Short.MAX_VALUE)
.addComponent(c1)))
.addGroup(layout.createSequentialGroup()
.addGap(29, 29, 29)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayo
ut.Alignment.LEADING)
.addComponent(res,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.Group
Layout.Alignment.TRAILING)
.addComponent(salir)
.addGroup(layout.createSequentialGroup()
.addComponent(sumar)
.addGap(47, 47, 47)
.addComponent(restar)))
.addGap(18, 18, 18)
.addComponent(limpiar)))))
.addContainerGap(60, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1)
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.BASELINE)
.addComponent(c1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.U
NRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.BASELINE)
.addComponent(c2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3))
.addGap(32, 32, 32)
.addComponent(res)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.R
ELATED, 54, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Ali
gnment.BASELINE)
.addComponent(sumar)
.addComponent(restar)
.addComponent(limpiar))
.addGap(20, 20, 20)
.addComponent(salir)
.addContainerGap())
);
pack();
}// </editor-fold>
/**
* @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) ">
java.util.logging.Logger.getLogger(botones.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(botones.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(botones.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(botones.class.getName()).log(java.util.log
ging.Level.SEVERE, null, ex);
}
//</editor-fold>