Multidimensional Array: อนันต์ ผลเพิ่ม Anan Phonphoem

Slides:



Advertisements
Similar presentations
Introduction to Programming Lecture 15. In Today’s Lecture Pointers and Arrays Manipulations Pointers and Arrays Manipulations Pointers Expression Pointers.
Advertisements

Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic JavaScript: Arrays.
1 Arrays in JavaScript Name of array (Note that all elements of this array have the same name, c ) Position number of the element within array c c[6] c[0]
1 Flowchart If – Then – Else อนันต์ ผลเพิ่ม Anan Phonphoem
Introduction to Application Programming IST 256 Application Programming for Information Systems Xiaozhong Liu
CS Data Structures Chapter 2 Arrays and Structures.
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
Arrays (Part II). Two- and Multidimensional Arrays Two-dimensional array: collection of a fixed number of components (of the same type) arranged in two.
Click Here to Begin the Game CHOICE 1CHOICE 2CHOICE 3 CHOICE CHOICE
Multi-Dimensional Arrays in Java "If debugging is the process of removing software bugs, then programming must be the process of putting them in." -- Edsger.
1 Advanced Plotting ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Computer Programming for Engineers. Outline Tic-Tac-Toe (O-X Game) Drawing 3x3 grid Receiving the inputs Checking for a winner Taking turns between.
© Copyright 2013 by Pearson Education, Inc. All Rights Reserved. 1 Chapter 8 Multidimensional Arrays.
1 Programming with MATLAB ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
NAT-PAT-DHCP ผศ. ดร. อนันต์ ผลเพิ่ม Asst.Prof.Anan Phonphoem, Ph.D. Computer Engineering Department Kasetsart.
Chapter overview This chapter focuses on Array declaration and use Bounds checking and capacity Arrays storing object references Variable length parameter.
Arrays and Strings. Why? Consider a class of 30 students, each has a score for hw1  Do we want to have 30 variables with different names?  Would it.
Data Structure CS 322. What is an array? Initializing arrays Accessing the values of an array Multidimensional arrays LAB#1 : Arrays.
1 Matrix Operation ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Духовні символи Голосіївського району
1 Advanced Plotting 2 (Example from Aj.Jim) ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
EGR 115 Introduction to Computing for Engineers MATLAB Basics 1: Variables & Arrays Wednesday 03 Sept 2014 EGR 115 Introduction to Computing for Engineers.
CS Class 15 Today  More practice with arrays  Introduction to Multi-dimensional arrays Announcements  Programming project #4 due 10/23 by midnight.
1 Conditional Statements + Loops ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
1 for – while – switch ผศ. ดร. อนันต์ ผลเพิ่ม Anan Phonphoem
Array : 1-dimension อนันต์ ผลเพิ่ม Anan Phonphoem
2-dimensional Arrays A 2-dimensional array has rows and columns It is actually an “array of arrays” A Tic-Tac-Toe board is an example of a 3 by 3 2-d array.
Copyright ©2005  Department of Computer & Information Science Multidimensional Arrays.
 Introducing Arrays  Declaring Array Variables, Creating Arrays, and Initializing Arrays  Copying Arrays  Multidimensional Arrays  Search and Sorting.
1.8 Multidimensional Arrays academy.zariba.com 1.
Data Structures: Multi-Dimensional Arrays Damian Gordon.
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.
CSI 3125, Preliminaries, page 1 Arrays. CSI 3125, Preliminaries, page 2 Arrays Group of related typed variables that referred to a common name Each data.
COMP 110: Spring Announcements Lab 7 was due today Binary Expression Assignment due Friday.
© 2004 Pearson Addison-Wesley. All rights reserved7-1 Array review Array of primitives int [] count; count = new int[10]; Array of objects Grade [] cs239;
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.
1 2-d Arrays. 2 Two Dimensional Arrays We have seen that an array variable can store a list of values Many applications require us to store a table of.
Two-Dimensional Arrays
Networking and Internetworking Devices
1-7 Adding and Subtracting Integers
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
Multidimensional array
Why We Need Car Parking Systems - Wohr Parking Systems
Types of Stack Parking Systems Offered by Wohr Parking Systems
Add Title.
Presentation transcript:

Multidimensional Array: อนันต์ ผลเพิ่ม Anan Phonphoem

One dimensional Array Type ScoreArr = array[1..6] of integer; var score: ScoreArr; Score[1] Score[2] Score[3] Score[4] Score[5] Score[6]

Election Score Type ScoreArr = array[1..6] of integer; var Score: ScoreArr; Score Candidate #

Election: 3 districts Type ScoreArr = array[1..6] of integer; var scoreD1, scoreD2, scoreD3: ScoreArr; ScoreD1ScoreD2ScoreD Candidate #

2-dimensional array ScoreD1ScoreD2ScoreD Score

2-dimensional array Score Candidate #District 123 Score[candidate, district] Score[1,1] = Score[4,2] = Score[5,3] =

2-dimensional array Score 123 Type Score2Arr = array[1..6,1..3] of integer; var Score: Score2Arr;

Accessing Array elements Score[1,1] = 10 For I := 1 to 6 do Readln(Score[I,1]); For candidate := 1 to 6 do For district := 1 to 3 do Readln(Score[candidate, district]); For district := 1 to 3 do Writeln(Score[3,district]);

Practice 1 Write a program to find the winner of the election in each district Write a program to find the winner of the election Score 123

Practice 2 Write a program to add two table =

Practice 3 Write an O-X game (Tic-Tac-Toe)

3-dimensional array X X X X - - X X - X X X - X - X PM Midnight Movie Title: Men in Black II Seat[round, row, col] Seat[Evening, 3, 1] = Available; Seat[Midnight, 2, 4] = Taken;