Question: Convert the following Java program to Ada: public class Array2D { public static void main (String args []){ Scanner sc = new Scanner ( System.in);

Convert the following Java program to Ada:

public class Array2D {

public static void main (String args []){

Scanner sc = new Scanner ( System.in);

int [] x = { 10, 20, 30, 40 };

System.out.println( "x's length is: " + "("+ x.length +")"+ " <===> " + Arrays.toString( x ) );

int [][] y = { { 10, 20 , 30, 40 } , {50, 60, 70, 80} , { 90, 100, 200, 300 } , { 400, 500, 600, 700 } , { 800, 900, 1000, 1100 } };

y [2][1] = 10;

System.out.println("The number of rows if the matrix y: " + y.length );

System.out.println("The number of columns in matrix y: " + y[0].length);

System.out.println( " Array : " );

for ( int i = 0 ; i < y.length ; i ++ ){ // this is for rows 0 to 4 \\

for ( int j = 0 ; j < y[i].length ; j++){ // this if for columns 0 to 5 \\

System.out.print( y [i][j] + "\t" );

} // second for loop

System.out.println("");

} // first for loop

}// end of main

}// end of class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!