{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

16_record_files

16_record_files - Introduction to Computers and Programming...

Info icon This 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 – Day number, month name, and year
Image of page 1

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

View Full Document Right 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
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
Image of page 3

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

View Full Document Right 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:
Image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern