Guest User

Untitled

a guest
Oct 20th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. import javax.swing.JOptionPane;
  2.  
  3. public class paradigma {
  4. public static void main(String[] args) {
  5. suma();
  6.  
  7. }
  8. public static int[] ingresados() {
  9. int arreglo[] = new int[10];
  10. for (int i = 0; i < 10; i++) {
  11. arreglo[i] = Integer.parseInt(JOptionPane.showInputDialog("ingredas"));
  12. }
  13. return arreglo;
  14. }
  15. public static void suma() {
  16. int suma = 0;
  17. for (int i = 0; i < ingresados().length; i++) {
  18. suma += ingresados()[i];
  19. }
  20. System.out.println(suma);
  21. }
  22. }
Add Comment
Please, Sign In to add comment