Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions