1 / 5

ME 142 Engineering Computation I

ME 142 Engineering Computation I. Arrays. Key Concepts. Array Basics 1-Dimensional Arrays. Array Basics. Variable that stores multiple data values under a single name Individual data values within the array are accessed by an index or subscript within a loop. Array Syntax.

Download Presentation

ME 142 Engineering Computation I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. ME 142Engineering Computation I Arrays

  2. Key Concepts Array Basics 1-Dimensional Arrays

  3. Array Basics • Variable that stores multiple data values under a single name • Individual data values within the array are accessed by an index or subscript within a loop

  4. Array Syntax Dim ArrayName(size) Dim ArrayName(LowerIndex to UpperIndex) Dim ArrayName(size) as Double Dim ArrayName(size1, size2)

  5. 1- Dimensional Array Example Sub demo() Dim A(1 To 5) For i = 1 To 5 A(i) = InputBox("Enter number:") Next I Total = 0 For i = 1 To 5 Total = Total + A(i) Next I MsgBox "Total = " & Total End Sub

More Related