Arrays Part 2.

Slides:



Advertisements
Similar presentations
1.
Advertisements

One Dimensional Arrays
I can order decimal numbers up to three decimal places (4a)
Understanding the Need for Sorting Records
Chapter 9: Advanced Array Manipulation
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Microsoft Visual Basic 2010: Reloaded Fourth Edition
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 9A Sorting (Concepts)
Visual C++ Programming: Concepts and Projects
Programming with Microsoft Visual Basic 2005, Third Edition
An Introduction to Programming with C++ Fifth Edition
Arrays-Part 1. Objectives Declare and initialize a one-dimensional array Store data in a one-dimensional array Display the contents of a one-dimensional.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
Arrays.
Arrays Data Structures - structured data are data organized to show the relationship among the individual elements. It usually requires a collecting mechanism.
Introduction to Programming with C++ Fourth Edition
C++ for Engineers and Scientists Third Edition
Arrays. Objectives Learn about arrays Explore how to declare and manipulate data into arrays Learn about “array index out of bounds” Become familiar with.
Programming Logic and Design Fourth Edition, Comprehensive
Chapter 7: Arrays. In this chapter, you will learn about: One-dimensional arrays Array initialization Declaring and processing two-dimensional arrays.
1 Microsoft Visual Basic 2010 Arrays. 2 Using a One-Dimensional Array Lesson A Objectives After completing this lesson, you will be able to:  Declare.
Array Processing Simple Program Design Third Edition A Step-by-Step Approach 7.
EGR 2261 Unit 8 One-dimensional Arrays  Read Malik, pages in Chapter 8.  Homework #8 and Lab #8 due next week.  Quiz next week.
C++ for Engineers and Scientists Second Edition Chapter 11 Arrays.
An Introduction to Programming with C++ Fifth Edition Chapter 11 Arrays.
Computer Programming TCP1224 Chapter 11 Arrays. Objectives Using Arrays Declare and initialize a one-dimensional array Manipulate a one-dimensional array.
Lists in Python Selection Sort Algorithm. Sorting A very common activity for computers Not just in business, sorting is used in databases, graphics, simulations,
Programming with Microsoft Visual Basic 2012 Chapter 9: Arrays.
An Introduction to Programming with C++ Sixth Edition Chapter 12 Two-Dimensional Arrays.
Visual C# 2005 Using Arrays. Visual C# Objectives Declare an array and assign values to array elements Initialize an array Use subscripts to access.
Lecture #15 ARRAYS By Shahid Naseem (Lecturer). 2 ARRAYS DEFINITION An array is a sequence of objects of same data type. The objects in an array are also.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 19 A Ray of Sunshine.
Chapter 11.  Large amounts of data are often stored in a database—an organized collection of data.  A database management system (DBMS) provides mechanisms.
Chapter 9: Sorting and Searching Arrays
Chapter 11 - JavaScript: Arrays
Chapter 6: Using Arrays.
An Introduction to Programming with C++ Sixth Edition
Review Deleting an Element from a Linked List Deletion involves:
Arrays 2.
Chapter 7: Working with Arrays
Computer Programming BCT 1113
Microsoft Visual Basic 2005: Reloaded Second Edition
Chapter 7: Array.
Chapter 8 Arrays Objectives
Chapter 5: Arrays: Lists and Tables
Siti Nurbaya Ismail Senior Lecturer
Array ISYS 350.
Prof: Dr. Shu-Ching Chen TA: Yimin Yang
Visual Basic .NET BASICS
CSCI 3328 Object Oriented Programming in C# Chapter 7: Arrays
Prof: Dr. Shu-Ching Chen TA: Hsin-Yu Ha
Introduction to LINQ Chapter 11 10/28/2015 Lect 4 CT1411.
CSCI 3327 Visual Basic Chapter 8: Introduction to LINQ and Collections
Chapter 8 Arrays Objectives
Introduction to LINQ Chapter 11.
Prof: Dr. Shu-Ching Chen TA: Haiman Tian
Object Oriented Programming in java
Tutorial 11 Arrays Tutorial 11: Arrays.
CSCI 3328 Object Oriented Programming in C# Chapter 7: Arrays
Topics Sequences Introduction to Lists List Slicing
Compiler Design Second Lecture.
Searching and Sorting Arrays
Single-Dimensional Arrays chapter6
CIS16 Application Development and Programming using Visual Basic.net
Chapter 8 Arrays Objectives
Topics Sequences Introduction to Lists List Slicing
Arrays Imran Rashid CTO at ManiWeber Technologies.
Applications of Arrays
Arrays.
Presentation transcript:

Arrays Part 2

Objectives Search a one-dimensional array Compute the average of a one-dimensional array’s contents Find the highest entry in a one-dimensional array Update the contents of a one-dimensional array Sort a one-dimensional array

Manipulating One-Dimensional Arrays Array elements can be used like any other variable Examples: Display the contents of an array Access an array element using its subscript Search the array Calculate the average of data stored in a numeric array Find the highest value stored in an array Update array elements Sort array elements

The For Each…Next Statement Used to code a loop which processes each element in a group or array Creates a variable used to represent each item in the group or array Data type of the element must match the data type of the group Syntax: For each element [as datatype} in group Statement(s) Next

The For Each…Next Statement (cont’d) Hands-on Example

Searching a One-Dimensional Array Hands-on Example

Calculating the Average Amount Stored in a One-Dimensional Numeric Array Sample application: Find the average from an array of test scores Length property: number of elements in the array

Determining the Highest Value Stored in a One-Dimensional Array Hands-on Example

Updating the Values Stored in a One-Dimensional Array Hands-on Example

Sorting the Data Stored in a One-Dimensional Array Sorting: arranging data in a specific order Ascending: first element is smallest, last element is largest Descending: first element is largest, last element is smallest Array.Sort method: used to sort elements in a one-dimensional array in ascending order Array.Reverse method: used after Array.Sort method to change to descending order

Sorting the Data Stored in a One-Dimensional Array (con’d) Hands-on Example