Xtrminator

Primer Parcial Cetys Progra

Mar 1st, 2012
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2.  
  3.  
  4.  
  5.  
  6. public class Calificaciones
  7. {
  8.  
  9. public static void main(String args[])
  10. {
  11. int arreglo [] = new int [10];
  12. int x = 0;
  13.  
  14.  
  15. for(int y=1; y!=11; y++)
  16.  
  17. {
  18.  
  19. arreglo[x] = Integer.parseInt(JOptionPane.showInputDialog(null, "Ingresa la Calificacion " +y, JOptionPane.QUESTION_MESSAGE));
  20. x++;
  21. }
  22.  
  23. int promedio;
  24.  
  25.  
  26. promedio = arreglo[0] + arreglo[1] + arreglo[2] + arreglo[3] + arreglo[4] + arreglo[5] + arreglo[6] + arreglo[7] + arreglo[8] + arreglo[9];
  27. int promedio2 = promedio / 10;
  28.  
  29. JOptionPane.showMessageDialog(null,"Tu promedio es:" +promedio2,"Resultado" ,JOptionPane.PLAIN_MESSAGE);
  30. }
  31.  
  32.  
  33.  
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment