Programming for Computing 07 - 08

Chapter: Arrays

Module Admin   Contents, Index   Schedule  
1: Intro to VB    2: First Program and Projects    3: Variables, assignment, Strings    4: Type Conversion, InputBox, Constants    5:Built-in Functions    6: If - decisions    7: Loops - while, for    Example - find smallest    8: Scopes: local, global    9: Writing Procedures.Parameters, Functions   
10: Objects    11: Design    12: Testing    13: Graphics    14: Controls and events    15: Listboxes    16: Arrays    17: Files    18: The Command Line   

Appendices(links etc)   Additional Lectures    Tutorials (not in printed notes)     Selected solutions (not in printed notes)     Assignments    Additions and Errata   

new

The  schedule page has info on what we will do each week.

Why do we do this...

 


Section 16.0

Most programs process sequences - lists of data. For example:
  • a list of names in a database
  • a list of file names in a folder
  • the list (collection) of bytes in an mp3 file
  • the text of a web page.
Arrays, lists, are quite similar. Each of these can support these operations:
  • creating a new list
  • inserting a new item in the list (e.g. insert an item at the end of the list, or insert a new item at position number 37)
  • amending an existing item (e.g. amend item number 32 to "Mike" )
  • deleting an item (e.g. delete item number 24)
  • recalling an item (e.g. store item number 27 into x)

Here are the notes on arrays. arraynet.doc

Arrays are quite primitive - but all programming languages have them. Collections are a newer idea and a re more powerful. Most modern languages have some kind of collection facility. In VB and Java, we have the ArrayList. In fact, behind the scenes of a list box, something like an arraylist is used to store the data.

However, remember that they are all similar. We have a set of items, and we can fetch a single item and process it.

Module Admin   Contents, Index