
Ayuda programacion Java
Publicado por Jonathan (1 intervención) el 09/09/2016 22:02:22

necesito ayuda con este programa, apenas he echo premio de comision 30% (Matriz E. cocina)
pero tengo un problema en el que, cualquier valor que ingrese me saca el 30%, y solo debe ser al vendedor que vendio mas, por favor ayuda aqui les dejo el codigo que llevo hasta ahora
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import javax.swing.JOptionPane;
/**
*
* @author Ideapad 300
*/
public class Correccion {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
int N;
int ventas_C[] = new int[20];
double total_[] = new double[2];
int VentaMayor = 0;
try {
N = Integer.parseInt(JOptionPane.showInputDialog("Digite Cantidad de venderdores"));
int Matriz_C[][] = new int[N][2];
int Matriz_A[][] = new int[N][2];
for (int i = 0; i < Matriz_C.length; i++) {
for (int j = 0; j < Matriz_C[0].length; j++) {
ventas_C[j] = Integer.parseInt(JOptionPane.showInputDialog("Digite ventas del vendedor : " + (i + 1) + " Del dia " + (j + 1)));
if (ventas_C[j] > VentaMayor) {
total_[j] = (int) ventas_C[j] * 0.30;
}
System.out.println("el ganador es el vendedor" + ventas_C[i]);
}
}
} catch (NumberFormatException ex) {
JOptionPane.showMessageDialog(null, "Atencion, ha ingresado un caracter NO numerico", "Error", JOptionPane.ERROR_MESSAGE);
}
}
Valora esta pregunta


0