Download presentation

Presentation is loading. Please wait.

Published byJorge Hoosier Modified over 2 years ago

1
Warm up Determine the value stored in each of the following: – gradeTable[ 0 ][ 0 ] – gradeTable[ 1 ][ 1 ] – gradeTable[ 3 ][ 4 ] – gradeTable[ 5 ][ 2 ]

2
More 2-D Arrays

3
Different Numbers of Cells per Row Usually you think of a 2D array as a table Is this possible: int[][] uneven = {{ 1, 9, 4 }, { 0, 2}, { 0, 1, 2, 3, 4 }};

4
Different Numbers of Cells per Row You have to think of "arrays of references to 1D arrays.“

5
Different Numbers of Cells per Row Determine the value stored in each of the following: – uneven[ 0 ][ 0 ] – uneven[ 1 ][ 1 ] – uneven[ 0 ][ 4 ] – uneven[ 2 ][ 4 ]

6
Printing a 2D Array // declare and construct a 2D array int[][] uneven = { { 1, 9, 4 }, { 0, 2}, { 0, 1, 2, 3, 4 } }; // print out the array for(int row=0; row < uneven.length; row++) { System.out.print("Row " + row + ": "); for(int col=0; col < uneven[row].length; col++) System.out.print(uneven[row][col] + " "); System.out.println(); }

Similar presentations

OK

Multidimensional Arrays. Example Write a program to keep track of all warmup scores for all students. Need a list of a list of scores Student – score.

Multidimensional Arrays. Example Write a program to keep track of all warmup scores for all students. Need a list of a list of scores Student – score.

© 2018 SlidePlayer.com Inc.

All rights reserved.

Ads by Google

Ppt on next generation 2-stroke engine parts English 8 unit 12 read ppt on iphone Ppt on council of ministers kuwait Free ppt on forest society and colonialism notes Ppt on travels and tourism Sense organs anatomy and physiology ppt on cells Ppt on places in our neighbourhood download Ppt on time management in marathi Ppt on linear equation in two variables for class 9 download Ppt on mass media in education