simple array
Simple code to do a simple thing.....Allows user to enter 10 number and puts those numbers into a number array, the prints it back to the user in reverse.
AI
Resumen de IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Código fuente
import javax.swing.JOptionPane;
public class NumArray
{
public static void main(String[] args)
{
String A;
int x = 0;
System.out.println();
System.out.println("Loading the array with values going forward");
System.out.println();
int[] Num1 = new int[10];
for (int i = 0; i <=9;i++){
A = JOptionPane.showInputDialog(null,"Please Enter A Whole Number","Enter A Number",JOptionPane.INFORMATION_MESSAGE);
x = Integer.parseInt(A);
System.out.println(x);
Num1[i]=x;
x = 0;
}
System.out.println();
System.out.println("Your array going in reverse");
System.out.println();
for (int i = 9; i >= 0; i--){
System.out.println(Num1[i]);
}
}
}
Comentarios originales (3)
Recuperado de Wayback Machine