16_record_files

16_record_files - Introduction to Computers and Programming Prof I K Lundqvist Reading FK pp 367-384 415-420 214-217 Structured data types So far

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Computers and Programming Lecture 16 Structured data types scalar (single value) data types array records: data structure that collects together into one unit several related items of data number –… Prof. I. K. Lundqvist Reading: FK pp. 367-384, 415-420, 214-217 Oct 8 2003 •So far: – structured data type: – Name, phone number, sex, age, and weight
Background image of page 1

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

View Full DocumentRight Arrow Icon
Arrays 1 , i 2 ,..,i n ) elements. for I in 1 loop ; for I in 1 loop for J in 1 .. N loop Put (B(I,J)); end loop ; end loop ; Records design a record declare record types and variables use a record • Access elements using Indices – Single Dimension arrays A(I) – Two dimensional arrays A(I,J) – N dimensional array A(i • Loops can be used to access control to .. N Get (A(I)); end loop .. M To use records we need to know: 1. How to 2. How to 3. How to
Background image of page 2
1. Designing Records identify the items of data that are relevant data structure diagram to show the relevant information names for the overall structure, and for the individual fields data types of the fields Example1 Fitness club name : names; phone : phones; sex : sexes; age : ages; weight : weights; name phone sex age weight persons • To design a record: in this application –use a • decide on – determine the -- string sub-type -- string sub-type -- enumerated type -- integer sub-range -- float sub-type
Background image of page 3

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

View Full DocumentRight Arrow Icon
2. Declaring records type record_type_name field_name_1 : field_type_1; field_name_2 : field_type_2; ; 2. Declaring records positional aggregate: average_male : constant persons :=
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/28/2012 for the course AERO 16.01 taught by Professor Markdrela during the Fall '05 term at MIT.

Page1 / 12

16_record_files - Introduction to Computers and Programming Prof I K Lundqvist Reading FK pp 367-384 415-420 214-217 Structured data types So far

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online