HTML CSS PHP PERL

Workshop

 
Previous Table of Contents Next

Workshop

Quiz

1:

What kind of data does this appear to be?


01/30/2005,05:02,PM,2264,Listing19_1.pl

01/26/2005,08:26,PM,541,Listing19_2.pm

01/26/2005,08:24,PM,301,Listing19_3.pm

01/27/2005,09:01,PM,773,Listing19_4.pm

01/27/2005,09:20,PM,154,Listing19_5.pl

01/27/2005,09:40,PM,164,Listing19_6.pl

01/27/2005,10:19,PM,233,Listing19_7.pl

01/30/2005,04:27,PM,92,Listing19_8.pl

01/30/2005,05:05,PM,693,Listing19_9.pm


  1. Unstructured

  2. Table data

  3. Binary data

  4. Hierarchical data

2:

What kind of data does this appear to be?


Othello, The Moor of Venice

    Dramatis Personae

    Act I

        Scene 1: Venice, A street.

        Scene 2: Another street.

        Scene 3: Council chamber

    Act II

        Scene 1: Sea port in Cyprus

        Scene 2: Street

        Scene 3: Hall in the castle


  1. Unstructured

  2. Table data

  3. Binary data

  4. Hierarchical data

3:

What kind of data does this appear to be?


There once was a man from Nantucket,

Who kept all of his cash in a bucket,

But his daughter, named Nan,

Ran away with a man,

And as for the bucket, Nantucket...


(Published in the Princeton Tiger, 1924)

  1. Unstructured

  2. Table data

  3. Binary data

  4. Hierarchical data

  5. Other

Answers

A1:

(b) This is table data, specifically a format called Comma Separated Value, or CSV. It's a common data-interchange format, and many tools including Microsoft Excel deal with it quite well.

A2:

(d) This is hierarchical data. The meaning of each line depends heavily on where it appears within the outline. Where the scenes appear changes the meaning of the document.

A3:

(a) Unstructured. As far as this hour is concerned, this is unstructured data. To be fair though, this is an example of limerick, and limericks have a definite structure. Answering (e) Other will get you partial credit.

Activities

  • The functions that were written in this chapterread_data, add_descriptions, print_order, and read_bulkare very well suited for object-oriented programming. Design an object-oriented module that:

    • Has one constructor that takes a mail message and returns an Order object.

    • Has a function that takes an XML filename and returns an array of Order objects.

    • Has add_descriptions and print_order as methods for the Order object.

    Previous Table of Contents Next
    © 2000- NIV