Visual Basic .NET BASICS

Slides:



Advertisements
Similar presentations
Etter/Ingber Arrays and Matrices. Etter/Ingber One-Dimensional Arrays 4 An array is an indexed data structure 4 All variables stored in an array are of.
Advertisements

Introduction to arrays
One Dimensional Arrays
 “Regular” variable ◦ Holds a single value ◦ For example Dim Student1 as String Dim Student2 as String Dim Student3 as String … Dim Studentn as String.
Programming with Microsoft Visual Basic 2005, Third Edition
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 8 Arrays.
© The McGraw-Hill Companies, 2006 Chapter 5 Arrays.
1 ICS103 Programming in C Lecture 12: Arrays I. 2 Outline Motivation for One-dimensional Arrays What is a One-dimensional Array? Declaring One-dimensional.
An Object-Oriented Approach to Programming Logic and Design Chapter 7 Arrays.
Arrays. Objectives Learn about arrays Explore how to declare and manipulate data into arrays Learn about “array index out of bounds” Become familiar with.
Microsoft Visual Basic 2008 CHAPTER NINE Using Arrays and File Handling.
Microsoft Visual Basic 2005 CHAPTER 9 Using Arrays and File Handling.
Using Arrays and File Handling
Chapter 8: Arrays.
Array Cs212: DataStructures Lab 2. Array Group of contiguous memory locations Each memory location has same name Each memory location has same type a.
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 5 Arrays.
Arrays Chapter 8. Chapter 8 - Part 12 Variable and Variable Array Variable Stores only one value Variable Array Variable that has 1 symbolic name but.
Computer Programming TCP1224 Chapter 11 Arrays. Objectives Using Arrays Declare and initialize a one-dimensional array Manipulate a one-dimensional array.
1 Working with Data Structures Kashef Mughal. 2 Chapter 5  Please review on your own  A few terms .NET Framework - programming model  CLR (Common.
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.
ICS103 Programming in C Lecture 11: Arrays I
Programming with Microsoft Visual Basic 2012 Chapter 9: Arrays.
Array Size Arrays use static allocation of space. That is, when the array is created, we must specify the size of the array, e.g., int[] grades = new int[100];
Visual C# 2005 Using Arrays. Visual C# Objectives Declare an array and assign values to array elements Initialize an array Use subscripts to access.
Arrays Declaring arrays Passing arrays to functions Searching arrays with linear search Sorting arrays with insertion sort Multidimensional arrays Programming.
3/16/20161 … and now for… Sequences. 3/16/20162 Sequences Sequences represent ordered lists of elements. A sequence is defined as a function from a subset.
Introduction to programming in java Lecture 21 Arrays – Part 1.
13 Arrays CE : Fundamental Programming Techniques June 161.
Lesson 3 Functions. Lesson 3 Functions are declared with function. For example, to calculate the cube of a number function function name (parameters)
Arrays 1.
Arrays Chapter 7.
Arrays and Collections
ARRAYS.
Programming Right from the Start with Visual Basic .NET 1/e
ARRAYS (Extra slides) Arrays are objects that help us organize large amounts of information.
Chapter 6: Using Arrays.
Chapter 6 Arrays in C++ 2nd Semester King Saud University
Chapter 7: Working with Arrays
Computer Programming BCT 1113
Microsoft Visual Basic 2005: Reloaded Second Edition
IS 350 Arrays.
Two-Dimensional Arrays Lesson xx
C programming---Arrays
Collection in PL/SQL.
Chapter 7 Part 1 Edited by JJ Shepherd
Chapter 8 Arrays Objectives
2. Understanding VB Variables
One-Dimensional Array Introduction Lesson xx
Don’t Leave Home Without them
CSCI 3327 Visual Basic Chapter 7: Arrays
Lists in Python.
Chapter 8 Arrays Objectives
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.
Arrays Chapter 8 Copyright © 2008 W. W. Norton & Company.
Arrays An array is a collection of variables that all have the same name and the same data type. Each member of the array is known as an element of the.
Can store many of the same kind of data together
Arrays
Starting Out with Programming Logic & Design
Tutorial 11 Arrays Tutorial 11: Arrays.
Arrays Chapter 8 Copyright © 2008 W. W. Norton & Company.
Arrays.
Arrays ICS2O.
Arrays Week 2.
CIS16 Application Development and Programming using Visual Basic.net
Arrays Part 2.
Chapter 8 Arrays Objectives
Arrays in Java.
Programming Logic and Design Fifth Edition, Comprehensive
ICS103 Programming in C Lecture 12: Arrays I
Presentation transcript:

Visual Basic .NET BASICS Lesson 12 Arrays

Objectives Declare an array. Enter information into an array. yo Objectives Declare an array. Enter information into an array. Access the information in an array. Use loops with arrays. Use parallel arrays.

Declaring and Accessing Arrays An array allows you to refer to a series of variables by the same name and to use a number, called an index or subscript, to tell them apart.

Declaring Arrays Visual Basic .NET arrays are referred to as zero-based arrays because the index values start at zero. The number of values in the array must be declared. An array can also be declared with a list of initial values called an initialization list.

Accessing the Elements in an Array The index, or subscript, is used to identify the element to be processed. However you specify the index, it must be a value between zero and the upper bound.

Array Methods and Properties All arrays have a number of methods and properties that make using them easier. The Length property returns the number of elements in an array. The GetLowerBound and GetUpperBound methods return integers representing the lower and upper bounds of an array.

Using Loops with Arrays There are several common ways that arrays and loops are used together. A loop can be used to apply the same process to each element in an array. A loop can be used to prompt for input for each element in an array and set its value. An array can be searched by using an If statement in a loop that compares each element of the array with a specific value.

Parallel Arrays Parallel arrays are arrays of the same length where each element in one array is related to an element in the second array with the same index value.

Summary Visual Basic. NET supports arrays that use an index or subscript to access different variables with the same name. All elements of an array are of the same data type. Arrays are declared by specifying the upper bound of the array.

Summary (continued) Arrays can be declared using initialization lists that set the starting values of the array. When arrays are declared using initialization lists, the upper bound is calculated by the system based on the number of items in the list. Individual elements in an array are read or changed by using an index value in paren-theses to identify the element to use.

Summary (continued) The GetLowerBound and GetUpperBound methods can be used to check that an index value is in the allowable range. The Length method of an array returns the number of elements in an array. Arrays can be processed sequentially using a loop. Parallel arrays are any number of arrays, which may be of different data types, that hold information in corresponding elements.