Dale - Computer Science Illuminated 286

Dale - Computer Science Illuminated 286 - 8.3 Functionality...

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: 8.3 Functionality of Imperative Languages 259 Language Ada Record Variable Declaration and Usage .97* SlD‘"" , * SlD‘""7F‘S"i hhh .97* SlD‘""h)e " E 4Je=ez +el"4i .97* SlD‘""h. " E (’i .97* SlD‘""h5D\=l‘7we " E K:hYYi W .9* SlD‘"" .o * SlD‘""F‘S" hhh .9* SlD‘""h)e " E 4Je=ez +el"4 .9* SlD‘""h. " E (’ .9* SlD‘""h5D\=l‘we " K:hYY * SlD‘""F‘S" e9* SlD‘""i hhh e9* SlD‘""h9e " E 4Je=ez +el"4i e9* SlD‘""he " E (’i e9* SlD‘""hzD\=l‘we " E K:hYYi VB.NET C++ * SlD‘""7F‘S" is a record type; .97* SlD‘"" is a record variable. .97* SlD‘"" can be passed as a parameter, and the items within it can be accessed by giving their individual names. In our three examples, each name is a combination of the record name and the item name with a dot in between. Some languages allow the items within a record to be a subprogram. We look at how this is done when we look at the additional functionality of object-oriented languages in the next section. Arrays An array is a named collection of homogeneous items in which individual items are accessed by their place within the collection. The place within the collection is called an index. Some languages call the first place in the collection the 0th item and some languages allow the programmer to name how the items are to be addressed; that is, the first item might be called the ath item. When declaring an array, it is customary to tell the system how many items are in the collection, and the data type of each. Let’s look at the syntax necessary to declare an array of 10 integer items. ...
View Full Document

This note was uploaded on 01/13/2011 for the course CSE 1550 taught by Professor Marianakant during the Fall '10 term at York University.

Ask a homework question - tutors are online