Chapter 8 Summary

# Chapter 8 Summary - Chapter 8 Summary Chapter 8 Arrays and...

This preview shows pages 1–2. Sign up to view the full content.

Chapter 8 Summary Chapter 8: Arrays and More 8.1 Arrays Concept: An array is a group of variables with one name. This are accessed via a subscript All variable in an array must be of the same type. Declaring an array Dim ArrayName (Uppersubscript) as DataType The subscript is the highest value in the array. Dim intDays(30) as integer The above would declare the array intDays of the type integer. Because numbering starts at zero, there would be 31 values. It is possible to omit the subscript and declare it using implicit array sizing. For instance: Dim intDays() as integer = { 1, 2, 3, 4, 5, 6, 7, 8} The number 1 is stored at element zero, 2 at element 1, etc. Named constants If a value will not change, named constants may be used. Const intUPPER_LIMIT as integer = 25 This would assign the value 25 to UPPER_LIMIT and would not change The array would be: Dim intArray(intUPPER_LIMIT) as integer Loops may be used to access elements Const intUPPER_LIMIT as integer = 25 Dim intArray(intUPPER_LIMIT) as integer Dim intCount as integer For intCount = 0 to intUPPER_LIMIT

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern