Created
May 10, 2012 21:38
-
-
Save godie007/2656062 to your computer and use it in GitHub Desktop.
mire santi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package Empresa; | |
| import javax.swing.JOptionPane; | |
| public class Empresa { | |
| public static void main(String[] args) { | |
| int contador1 = 0; | |
| int contador2 = 0; | |
| int contador3 = 0; | |
| for (int i = 0; i < 3; i++) { | |
| String nom = JOptionPane.showInputDialog("nombre"); | |
| String sexo = JOptionPane.showInputDialog("Sexo"); | |
| int edad = Integer.parseInt(JOptionPane.showInputDialog("edad")); | |
| if (sexo.equals("m")) { | |
| contador2++; | |
| }else if (sexo.equals("f")) { | |
| contador3++; | |
| } | |
| if (nom.charAt(0) == 'a') | |
| contador1++; | |
| } | |
| System.out.println("Nombres por A:" + contador1 | |
| +" hombres: "+contador3+" mujeres: "+contador3+""); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment