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

Slides:



Advertisements
Similar presentations
For(int i = 1; i
Advertisements

Two-Dimensional Arrays Chapter What is a two-dimensional array? A two-dimensional array has “rows” and “columns,” and can be thought of as a series.
Senem KUMOVA METİN CS FALL 1 ARRAYS && SORTING && STRINGS CHAPTER 6 cont.
Arrays in JAVA CS 340 Software Design Muhammad Talha.
Engineering Problem Solving with C++ An Object Based Approach Chapter 7 Two-Dimensional Arrays and Matrices.
Important Notes Pay attention to file names!!! You must name them what we tell you to. mkdir – make a folder (make the ones we tell you to) rm – remove.
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
1 2-D Arrays Overview l Why do we need Multi-dimensional array l 2-D array declaration l Accessing elements of a 2-D array l Declaration using Initializer.
11-1 Chapter 11 2D Arrays Asserting Java Rick Mercer.
Arrays. Example Write a program to keep track of all students’ scores on exam 1. Need a list of everyone’s score Declare 14 double variables? What about.
Multiple-Subscripted Array
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
Building Java Programs Chapter 7.5
One Dimensional Arrays. Declaring references to array objects How would you declare a variable somearray that is an array of ints? int[] somearray;
11-1 Chapter 11 2D Arrays Asserting Java Rick Mercer.
Two dimensional arrays in Java Computer Science 3 Gerb Objective: Use matrices in Java.
SINGLE-DIMENSION ARRAYS. Data Structures It is a collection of scalar data types that are all referenced or accessed through one identifier – scalar type.
Multi-Dimensional Arrays Arrays that have more than one index: Example of differences between basic data types and arrays using integers: Basic integer:
Data Structure CS 322. What is an array? Initializing arrays Accessing the values of an array Multidimensional arrays LAB#1 : Arrays.
Духовні символи Голосіївського району
2D Arrays A multi dimensional array is one that can hold all the values above. You set them up like this: int[ ][ ] gradeTable = new int[7][5]; With the.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 7.
Get Longest Run Index (FR) public int getLongestRunIndex(int []values) { int maxRunStart = -1, maxRunLength = 1; int runStart = 0, runLength = 1; for(int.
Lecture 07. Do not have to create an array while declaring array variable [] variable_name; int [] prime; int prime[]; Both syntaxes are equivalent No.
Lab 3. Why Compressed Row Storage –A sparse matrix has a lot of elements of value zero. –Using a two dimensional array to store a sparse matrix wastes.
CiS 260: App Dev I. 2 Introduction to Arrays n An array is an object that contains a collection of components (_________) of the same data type. n For.
CMSC 150 LOOPS CS 150: Fri 20 Jan Representing DNA AGTCCAGTGTCAA.
Print Row Function void PrintRow(float x[ ][4],int i) { int j; for(j=0;j
CiS 260: App Dev I. 2 Introduction to Arrays n An array is an object that contains a collection of components (_________) of the same data type. n For.
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
 Introducing Arrays  Declaring Array Variables, Creating Arrays, and Initializing Arrays  Copying Arrays  Multidimensional Arrays  Search and Sorting.
© 2006 Pearson Addison-Wesley. All rights reserved Arrays of Greater Dimension One-dimensional arrays are linear containers. Multi-dimensional Arrays.
Data Structures: Multi-Dimensional Arrays Damian Gordon.
Two-Dimensional Data Class of 5 students Each student has 3 test scores Store this information in a two- dimensional array First dimension: which student.
Introduction to programming in java Lecture 23 Two dimensional (2D) Arrays – Part 3.
Two-Dimensional Arrays
Two Dimensional Array Mr. Jacobs.
Fifth Lecture Arrays and Lists
Object Oriented Programming
Yong Choi School of Business CSU, Bakersfield
Lecture 6 2d Arrays Richard Gesick.
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
Mixed Numbers Equivalent Simplest Form Comparing
Ps Module 7 – Part II 2D Arrays and LISTS 8/29/2019 CSE 1321 Module 7.
Presentation transcript:

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

More 2-D Arrays

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 }};

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

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 ]

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(); }