Ver Mensaje Individual
  #2 (permalink)  
Antiguo 18/06/2010, 21:43
afruizc
 
Fecha de Ingreso: abril-2010
Ubicación: Manizales
Mensajes: 91
Antigüedad: 14 años
Puntos: 2
Respuesta: Ejercicio en java - Porcentaje de Varones y Mujeres

Cita:
Iniciado por vallenet Ver Mensaje
int Varones = Integer.parseInt (txtVarones)();
int Mujeres = Integer.parseInt (txtMujeres)();
int PorVarones = (Varones * 100) / (Varones + Mujeres);
int PorMujeres = (Mujeres * 100) / (Mujeres + Varones);

lblPorVarones.setText("" + PorVarones + "%");
lblPorVarones.setText("" + PorMujeres + "%");
yo creo que lo que falta corregir es esto

Código Java:
Ver original
  1. int Varones = Integer.parseInt(txtVarones.getText());
  2. int Mujeres = Integer.parseInt(txtMujeres.getText());

de resto, el código del botón creo esta bien

saludos