Programming Right from the Start with Visual Basic .NET 1/e

Slides:



Advertisements
Similar presentations
1.
Advertisements

The simple built-in data types of the C language such as int, float, - are not sufficient to represent complex data such as lists, tables, vectors, and.
Programming Logic and Design Sixth Edition
Arrays Chapter 6. Outline Array Basics Arrays in Classes and Methods Sorting Arrays Multidimensional Arrays.
An Introduction to Programming with C++ Fifth Edition
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
Introduction to Programming with C++ Fourth Edition
Chapter 8 Arrays and Strings
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the basic concepts and uses of arrays ❏ To be able to define C.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Chapter 9 Designing Databases Modern Systems Analysis and Design Sixth Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich.
Programming Right from the Start with Visual Basic .NET 1/e
Algorithm and Programming Array Dr. Ir. Riri Fitri Sari MM MSc International Class Electrical Engineering Dept University of Indonesia 15 March 2009.
ARRAYS 1 Week 2. Data Structures  Data structure  A particular way of storing and organising data in a computer so that it can be used efficiently 
1 © 2002, Cisco Systems, Inc. All rights reserved. Arrays Chapter 7.
Objectives - 11  We will work with processing Arrays.  Objectives:  Describe the concept of an array and its benefits.  Define the terms index, traverse,
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 5 Arrays.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 10: Applications of Arrays (Searching and Sorting) and the vector Type.
Arrays Arrays in C++ An array is a data structure which allows a collective name to be given to a group of elements which all have.
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.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 8 Arrays.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter Arrays, Timers, and More 8.
Arrays. 2 An array is a variable that holds a collection of related data values. Each of the values in an array is called an element. Each element in.
CHAPTER 6 ARRAYS IN C++ 2 nd Semester King Saud University College of Applied studies and Community Service CSC 1101 By: Fatimah Alakeel Edited.
Programming with Microsoft Visual Basic 2012 Chapter 9: Arrays.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
SEQUENTIAL AND OBJECT ORIENTED PROGRAMMING Arrays.
Programming Logic and Design Fifth Edition, Comprehensive Chapter 6 Arrays.
 2005 Pearson Education, Inc. All rights reserved Arrays.
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 19 A Ray of Sunshine.
Opener: Find three consecutive odd integers whose sum is -63 Integer #1 = n Integer #2 = n + 2 Integer #3 = n + 4 (n) + (n + 2) + (n + 4) = -63 3n + 6.
13 Arrays CE : Fundamental Programming Techniques June 161.
Data Structures & Algorithms CHAPTER 2 Arrays Ms. Manal Al-Asmari.
DEVRY CIS 115 F INAL E XAM 2 Check this A+ tutorial guideline at For more classes visit
Web Database Programming Using PHP
Programming Right from the Start with Visual Basic .NET 1/e
Chapter VII: Arrays.
3 Chapter Numeration Systems and Whole Number Operations
Arrays Chapter 7.
Chapter 6 Arrays in C++ 2nd Semester King Saud University
An Introduction to Programming with C++ Sixth Edition
1-1 Logic and Syntax A computer program is a solution to a problem.
Arrays 2.
Computer Programming BCT 1113
Microsoft Visual Basic 2005: Reloaded Second Edition
Web Database Programming Using PHP
Chapter 7 Part 1 Edited by JJ Shepherd
Chapter 8 Arrays Objectives
Chapter 5: Arrays: Lists and Tables
Visual Basic .NET BASICS
Chapter 6 - Arrays Outline 6.1 Introduction 6.2 Arrays
Programming Right from the Start with Visual Basic .NET 1/e
Chapter 8 Arrays Objectives
LESSON 13 – INTRO TO ARRAYS
Arrays We often want to organize objects or primitive data in a way that makes them easy to access and change. An array is simple but powerful way to.
Declaration, assignment & accessing
Starting Out with Programming Logic & Design
CS2011 Introduction to Programming I Arrays (I)
MSIS 655 Advanced Business Applications Programming
Data Structures (CS212D) Week # 2: Arrays.
Arrays Chapter 7.
Arrays Week 2.
CIS16 Application Development and Programming using Visual Basic.net
Chapter 8 Arrays Objectives
Programming Logic and Design Fifth Edition, Comprehensive
Chapter 9: More About Data, Arrays, and Files
Programming Fundamental
Applications of Arrays
Arrays.
Presentation transcript:

Programming Right from the Start with Visual Basic .NET 1/e 4 Arrays Programming Right from the Start with Visual Basic .NET 1/e

Objectives Understand the concept of an array Be able to declare arrays of various sizes Be able to populate and access the elements in an array

Objectives (cont.) Understand how to manipulate and process an array Consider multiple problems that benefit from an array solution Understand the Bubble Sort algorithm

4-1 Arrays An array is a variable that holds a collection of related data values. Each of the values in an array is called an element. Each element in the array is identified by an integer value called its index, which indicates the position of the element in the array.

4-1 Arrays (cont.) Most modern programming languages implement zero-based arrays, meaning that array index values begin with 0. The array length is the number of elements in the array. The upper bound of an array is the index of the last element.

4-1 Arrays (cont.)

Creating an Array In Visual Logic you create, or declare, an array using the Make Array command

Accessing Individual Elements of an Array To access individual array elements, you specify the array name and follow it with an index expression enclosed in parentheses. If you attempt to reference an array with an index value greater than the upper bound of the array, the result will be an out-of-bounds error.

When to Use Arrays Arrays are useful… when you are storing or processing large amounts of related data when information must be stored and processed twice

4-2 Above Average Problem (Mutual Funds) The Problem Jim is a financial analyst with many large investment clients. Each year Jim identifies ten different mutual funds that he shares with his clients for investing. At the end of each year he keeps the funds that performed better than the ten-fund average and replaces the others with new funds.

Analysis and Design

Analysis and Design (cont.)

4-3 Largest Value Problem (Highest GPA) The Problem The Alpha Beta Gamma fraternity is one of many popular Greek organizations on campus. Every semester, ABΓ recognizes the graduating brother who has the highest GPA. The number of graduates changes from semester to semester.

Analysis and Design

Analysis and Design (cont.)

Analysis and Design (cont.)

4-4 Working with Index Values (Two-Week Totals) The Problem Anthony owns a small business and plans to install new inventory hardware and software during the upcoming year. The installation process will require two weeks. To minimize the disruption that will occur during the migration, Anthony wants to deploy the system during the two weeks that had the lowest consecutive two-week total gross sales during the previous year.

Analysis and Design

Analysis and Design (cont.)

4-5 Simulation (Die Roll) The Problem A balanced die is equally likely to roll a 1, 2, 3, 4, 5, or 6. If a balanced die is rolled many times, the roll values should be evenly distributed. As the number of rolls increases, the distributions should become closer to one-sixth, or 16.67 percent. What are the percentages after forty rolls? What are the percentages after four hundred rolls?

Analysis and Design

Analysis and Design (cont.)

4-6 Parallel Arrays (Girl Scout Cookies) The Problem Every spring you look forward to buying a box of Caramel deLites Girl Scout cookies from your niece, Belinda. Her troop gives an award to the girl who sells the most boxes of cookies each year. They are looking to develop a software solution to assist in determining the annual award winner.

Analysis and Design Parallel arrays are two or more arrays whose elements are related by their position in the arrays.

Analysis and Design (cont.)

Analysis and Design (cont.)

Chapter Summary An array is a variable that holds a collection of related data values. Most modern programming languages implement zero-based arrays. To access individual array elements, you specify the array name and follow it with an index expression enclosed in parentheses.

Chapter Summary (cont.) Arrays contain a finite number of elements, each of which is referenced by a unique index. Parallel arrays are two or more arrays whose elements are related by their positions in the arrays. Bubble Sort is a simple sorting technique involving multiple passes through the array.

Programming Right from the Start with Visual Basic .NET 1/e 4 Arrays Programming Right from the Start with Visual Basic .NET 1/e