Objectives
• Declare and initialize a one-dimensional array
• Store data in a one-dimensional array
• Display the contents of a one-dimensional array
• Code a loop using the For Each…Next statement
• Access an element in a one-dimensional array
• 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
Objectives (cont’d)
• Create and manipulate parallel one-dimensional
arrays
• Create a structure
• Declare a structure variable
• Create and manipulate a one-dimensional array
of structures
• Create and initialize a two-dimensional array
• Store data in a two-dimensional array
• Search a two-dimensional array
Arrays
• A simple or scalar variable is one that is
unrelated to any other variable in memory
• An array is a group of variables that have
the same name and data type and are
related in some way
Arrays (continued)
• The most commonly used arrays are one-
dimensional and two-dimensional
• Programmers use arrays to store related
data in the internal memory of the
computer
One-Dimensional Arrays
• A one-dimensional array is simply a row
(or column) of variables
• Each element in an array is identified by a
subscript, which Visual Basic .NET
assigns to the variable when the array is
created
One-Dimensional Arrays
(continued)
• You refer to each variable in an array by its
name and the variable’s subscript
uiDisplayPriceButton’s
Click event procedure
using a two-
dimensional array
(continued)
The Tax Calculator Application
• John Blackfeather, the owner and
manager of the Perrytown Gift Shop,
should be able to use the application to
calculate the weekly federal withholding
tax for his employees
• To calculate the federal withholding tax,
the user would need to enter the taxable
wages in the Taxable wages text box and
then click the Calculate Tax button
The Tax Calculator Application
(continued)