Skip to content

Instantly share code, notes, and snippets.

@godie007
Created March 27, 2012 15:00
Show Gist options
  • Select an option

  • Save godie007/2216631 to your computer and use it in GitHub Desktop.

Select an option

Save godie007/2216631 to your computer and use it in GitHub Desktop.
trabajo paradigma
import javax.swing.JOptionPane;
public class ejercicio4 {
public static void main(String[] args)
{
int valorA = Integer.parseInt(JOptionPane.showInputDialog("ingrese valorA"));
int valorB = Integer.parseInt(JOptionPane.showInputDialog("ingrese valorB"));
int valorC = Integer.parseInt(JOptionPane.showInputDialog("ingrese valorC"));
if (valorA > valorB && valorA > valorC)
{
JOptionPane.showMessageDialog(null, "el valor A es el mayor");
} else if (valorA > valorC && valorA > valorA)
{
JOptionPane.showMessageDialog(null, "el valor B es el mayor");
} else if (valorA > valorA && valorA > valorB)
{
JOptionPane.showMessageDialog(null, "el valor C es el mayor");
}
}
}
import javax.swing.JOptionPane;
public class ejercicio5 {
public static void main(String[] args) {
double nota = Double.parseDouble(JOptionPane.showInputDialog("ingrese nota"));
if (nota < 0 || nota > 5) {
JOptionPane.showMessageDialog(null, "Advertencia", "Rango invalido", JOptionPane.ERROR_MESSAGE);
}
if (nota > 0 && nota < 2) {
JOptionPane.showMessageDialog ( null,
"el estudiante no puede habilitar !piede¡");
}else if (nota >= 2 && nota <= 2.99) {
JOptionPane.showMessageDialog ( null,
"el estudiante pierde !puede habilitar¡");
}else if (nota >= 3 && nota <= 5) {
JOptionPane.showMessageDialog ( null,
"el estudiante Aprobo la signatura");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment