Write a Java program that declares an array alpha of 50 integer elements. Initialize the array so that the first 25 elements are equal to the square of the index variable and the last 25 elements are equal to three times the index variable. Output the array so that 10 elements per line are printed. Exercise # 2 : Redo Exercise#1 so that the first 25 elements are randomely generated between 10 and 50 and the last 25 elements are randomely genrated bewteen -‐25 and 25. Exercise # 3: Modify Exercise#2 to count
Aucun commentaire:
Enregistrer un commentaire