I need help im a beginner.

1.Create one 2-dimensional array. The array will consist of numbers from 1 to 10. And will also contain the number in words. Display the values of the 2-dimensional array.
Sample output:
1 – One
2 – Two
3 – Three
Paste the program code here:


2. Create a program that will accept two integer numbers. These integer numbers will be the limit of the multiplication table. Store the values in a two dimensional array.
Sample output:
Enter x: 3
Enter y: 2
1 2 3
2 4 6
Paste the program code here:


3. Determine the output produced by the following program segment.
int ROWS = 3;
int COLS = 4;
int [ ] [ ] val = {{8,16,9, 52},{3,15,27,6},{14,25,2,10}};
for (int i=0; i < ROWS; i++)
{
for (int j= 0; j<COLS; j++)
System.out.print (val [i][j] + “ ” );
System.out.println ();
}

Write the Output:
Funny guy here.

*edit
ps isn't that java?
Last edited on
my prof said we need to use two-dimensional array
Well I haven't done much of java but I would assume it is similar to c++ and the example your teacher provided

1
2
3
4
5
int[][] array = {
{ 1 , 2 , 3 , 4 }, //3 rows 4 columns
{ 5, 6 , 7 , 8 } ,
{ 9 , 0 , 1 , 2 } ,
};


Also you are not asking for any help you are saying
imbapaps wrote:
Paste the program code here:


If you ask a specific question and provide some code people might be more willing to help.

*spelling
Last edited on
Topic archived. No new replies allowed.