Two dimensional arrays Please use speaker notes for additional information!

Slides:



Advertisements
Similar presentations
CS0007: Introduction to Computer Programming Arrays: Higher Dimensional Arrays.
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.
Introduction to arrays
Chapter 12 Array Processing and Table Handling. Defining Series of Input Fields Coding record with 24 independent hourly fields is cumbersome 01Temp-Rec.
ASP Web Server Controls Please use speaker notes for additional information!
Arrays. Memory organization Table at right shows 16 bytes, each consisting of 8 bits Each byte has an address, shown in the column to the left
Arrays (1) You create an array in LISP by using the function (make- array ). All elements are initially set to nil. To create a 1-dimensional array of.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 14 – Student Grades Application: Introducing.
Access Quiz October 24, The database objects bar in Access contains icons for tables, queries, forms and reports 1.True 2.False.
Computer Science 1620 Multi-Dimensional Arrays. we used arrays to store a set of data of the same type e.g. store the assignment grades for a particular.
Designing a Database Unleashing the Power of Relational Database Design.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 11P. 1Winter Quarter Arrays Lecture 11.
Two and three dimension tables Please use speaker notes for additional information!
1 Microsoft Access 2002 Tutorial 5 – Enhancing a Table’s Design, and Creating Advanced Queries and Custom Forms.
Homework for October 2011 Nikolay Kostov Telerik Corporation
12-1 Structured COBOL Programming Nancy Stern Hofstra University Robert A. Stern Nassau Community College James P. Ley University of Wisconsin-Stout John.
A Level Computing#BristolMet Session Objectives U2#S6 MUST identify different data types used in programming aka variable types SHOULD describe each data.
CPS120: Introduction to Computer Science Arrays. Arrays: A Definition A list of variables accessed using a single identifier May be of any data type Can.
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
Unit 23 Database and Spreadsheets Prepared by :Nahed Al-Salah.
Relational Lists.txt Excel can import multiple file types.txt Excel can import multiple file types.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
Relational Databases (MS Access)
Data Strcutures.
Two dimensional arrays in Java Computer Science 3 Gerb Objective: Use matrices in Java.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
Array - adding to array at run time Please see speaker notes for additional information!
Chapter 12 (part 2) Table Handling and Search Techniques.
Microsoft Access Database Software.
PHP Form Introduction Getting User Information Text Input.
 Decide on the information needed, and create column headings. (See picture below.)
12- 1 Chapter 12.  Single-Level OCCURS Clauses  Processing Data Stored in Array  Using OCCURS Clause for Table Handling  Use of SEARCH Statement 
CPS120: Introduction to Computer Science Lecture 15 Arrays.
The goal is to give an introduction to the mathematical operations with matrices. A matrix is a 2-dimensional arrangement of (real valued) data. The data.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 18 – Student Grades Application Introducing.
Excel 2013 PivotTables Making Information Usable.
Lab 6 (2) Arrays ► Lab 5 (1) Exercise Review ► Array Concept ► Why Arrays? ► Array Declaration ► An Example of Array ► Exercise.
Lookup Function (Think of a Book Index).  Need to fill based on what is in the these fields Array table.
CSCI 3328 Object Oriented Programming in C# Chapter 7: Arrays 1 Xiang Lian The University of Texas Rio Grande Valley Edinburg, TX 78539
Chapter 6Java: an Introduction to Computer Science & Programming - Walter Savitch 1 Chapter 6 l Array Basics l Arrays in Classes and Methods l Programming.
Introduction to Arrays. Objectives Distinguish between a simple variable and a subscripted variable. Input, output, and manipulate values stored in a.
1 Arrays of Arrays Quick review … arrays Arrays of arrays ≡ multidimensional array Example: times table Representation in memory Ragged arrays Example:
Arrays An array is an indexed data structure which is used to store data elements of the same data type. An array is an indexed data structure which is.
Howard Paul. Sequential Access Index Files and Data File Random Access.
Using a Database Access97 Please use speaker notes for additional information!
Sequential Processing to Update a File Please use speaker notes for additional information!
Two dimensional arrays A two dimensional m x n array A is a collection of m. n elements such that each element is specified by a pair of integers (such.
MULTI-DIMENSIONAL ARRAYS 1. Multi-dimensional Arrays The types of arrays discussed so far are all linear arrays. That is, they all dealt with a single.
Table of Contents Matrices - Definition and Notation A matrix is a rectangular array of numbers. Consider the following matrix: Matrix B has 3 rows and.
© 2004 Pearson Addison-Wesley. All rights reserved7-1 Array review Array of primitives int [] count; count = new int[10]; Array of objects Grade [] cs239;
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. A database is a collection of information organized to provide efficient retrieval. The collected information.
4.1 An Introduction to Matrices Katie Montella Mod. 6 5/25/07.
Chapter 4 Section 1 Organizing Data into Matrices.
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.
Pointers as arrays C++ Programming Technologies. Pointers vs. Arrays Pointers and arrays are strongly related. In fact, pointers and arrays are interchangeable.
Understanding Core Database Concepts Lesson 1. Objectives.
Chapter 6: Using Arrays.
Two-Dimensional Arrays
multi-dimensional arrays
Two-dimensional arrays
Introduction to the Array
Science Fair Data Table
Chapter 11 Data Structures.
Calendar like the Periodic Table
Searching an Array or Table
Multidimensional array
Multi-Dimensional Arrays
Adobe Acrobat DC Accessibility Data Tables
Understanding Core Database Concepts
I am now going to do queries in SQL
Presentation transcript:

Two dimensional arrays Please use speaker notes for additional information!

From City To City Looking at the data, I can see that if I fly: From New York to Budapest it will cost me $ From Providence to Istanbul it will cost $ From Boston to Prague it will cost $ From New York to Frankfort it will cost me $ From Providence to London it will cost me $525.00

From City To City To make this easier, I am going to assign numbers to the cities: From City To City 1 is Boston 1 is Istanbul 2 is Providence 2 is Budapest 3 is New York 3 is Frankfort 4 is London 5 is Prague Now, flying from New York to Budapest can be thought of as flying from the FROMCITY with the number 3 to the TOCITY with the number 2. This will be

From City To City Flying from Providence to Istanbul can be thought of as flying from the FROMCITY with the number 2 to the TOCITY with the number 1. This will be From City To City Flying from Boston to Prague can be thought of as flying from the FROMCITY with the number 1 to the TOCITY with the number 5. This will be

From City To City When I set up a two dimensional array in programming languages I have to deal with which I want to do first. Do I want to get to the right row and then to the right column or do I want to get to the column first and then the row. The most common is to pick the row first and then the column. If I call each element in the two dimensional array fare, then I want fare(row, column): fare(3,2) means going to the third row which is New York and then to the second column which is Budapest to get the fare 0f $526.89

From City To City Flying from Providence to Istanbul: fare(row,column) = fare(2,1) = From City To City Flying from Boston to Prague: fare(row, column) = fare(1,5) =

From City To City Input format: fromCity toCity I am now going to assume I either read a record or took in user input and that fromCity has a value of 3 and toCity has a value of 2. Now I am going to use fare which is defined as a cell in the table, subscripted or indexed by the two input fields fromCity and toCity to get the fare: fare(fromCity, toCity) Since fromCity = 3 and toCity = 2, I am getting fare(3,2) which has we know gets

From City To City Input format: fromCity toCity I am now going to assume I either read a record or took in user input and that fromCity has a value of 2 and toCity has a value of 1. Now I am going to use fare which is defined as a cell in the table, subscripted or indexed by the two input fields fromCity and toCity to get the fare: fare(fromCity, toCity) Since fromCity = 2 and toCity = 1, I am getting fare(2,1) which has we know gets

From City To City Input format: fromCity toCity I am now going to assume I either read a record or took in user input and that fromCity has a value of 1 and toCity has a value of 5. Now I am going to use fare which is defined as a cell in the table, subscripted or indexed by the two input fields fromCity and toCity to get the fare: fare(fromCity, toCity) Since fromCity = 1 and toCity = 5, I am getting fare(1,5) which has we know gets

Get Fare Take in fromCity and toCity fromCity >0 and fromCity < 4 toCity >0 and toCity < 6 YN Invalid fromCity N Invalid toCity Y fare(fromCity,toCity) End Get Fare