Homework Assignment 7

  1. This is the first time I have ever given this homework assignment so things may be especially unclear. Please post questions to Piazza so that I can clarify and so that everyone sees my clarifications.

  1. (20 points) Suppose you have been hired by the Great Smoky Mountains National Park to digitize their accumulated collection of:

    In addition to digitizing the collection, they also wish you to organize it and present it to the public via a web-site.

    Please discuss:

    1. how you will digitize the various elements of the collection.
    2. the storage formats you will use for the various elements of the collection.
    3. how you will store the collection (e.g., database, document collection, digital library, repository, etc.)

    Please refer to the information management notes and use the information they provide to justify your decisions.

  2. (20 points) Suppose I want to design an XML file that encodes exam questions and their answers. There are four types of exam questions: 1) true/false, 2) multiple choice, 3) essay, and 4) matching. The questions have the following information associated with them:

    Additionally each question contains the number of points that it is worth (the parts of an essay question do not have point values associated with them--only the overall question does).

    Your solution should show me the hierarchy of element tags you will use. Place an asterisk (*), plus (+), or question mark (?) next to an element if it can occur 0 or more times, 1 or more times, or 0/1 times respectively. If you require one of two elements or sets of elements, you can write <element1> | <element2> and use the following syntax:

    <element1> ... | <element2> ...

    Hints:

    1. Formatting, such as horizontal rules and question numbers/letters, should not be part of your structure.
    2. Here is a sample specification for the address book example presented in class:
      addressbook
          contact+
              name
                  firstname
                  middlename?
                  lastname
              address
                  street
                      street_number
                      street_name
                      street_suffix
                |
                  pobox?
                  apt
                  aptname
              city
              state
              zip
      
    3. Do not worry about the types of the data contained in the elements (e.g., integer, string, etc.). All I care about is the way you structure your data.
    4. Things you might want to think about:

      • What appear to be the major parts of the exam? The major parts might serve as tags.
      • Do the questions seem to fall into certain types of categories? The categories might serve as tags.
      • Do the questions seem to share some parts in common? How could you cleanly handle the fact that questions share some parts in common and have some differences?

  3. (20 points) This problem is meant to give you practice with using html tags to specify the structure of a web file and css formatting commands to specify the presentation of a web file. Modify my exam.html file so that it re-creates the formatting of the web-page shown in the attached pdf file. Do not worry about the page breaks in the printed document--the printed document should be thought of as one continuous web-page.

  4. (20 points) Suppose you have a credit card application form where you collect the following information. All fields are required unless they are explicitly indicated as optional.

    Here is some concrete data from three applications:

      • Smiley/H./Vander Zanden
      • 586-39-3968
      • 1678 Cardiff Rd./Columbus/OH/43221: No apartment name, unit number, or po box
      • smiley@gmail.com
      • 865-486-3153
      • credit cards
        • visa/3868-1048-4866-1048/10-20
        • master card/4948-3867-2396-4868/06-23
        • visa/3868-1796-1863-4593/03-22
        `
      • Daffy/Duck: no middle name
      • 396-83-5839
      • Warner Bros./Hollywood/CA/83969/po box 240 (Warner Bros. is the street address)
      • daffy.duck@warner.com
      • phone number: not provided
      • credit cards: none provided
      • Smoky/The/Bear
      • 484-48-1108
      • Great Smoky Mountains/Gatlinburg/TN/36939: no po box, apartment is "KOA Campground", and unit no is 362 (Great Smoky Mountains is the street address).
      • smoky@smokies.gov
      • phone number: not provided
      • credit cards
        • american express/4768-3968-6848-4753/08-19
        • master card/4948-5000-6000-5888/12-24

    For each of sql, xml, and json, show how you would represent the information for these three applicants (show me the concrete data, not just the sql table/column names or the xml element tags--I want to see what the file would like).

    1. sql: Put the data into the appropriate tabular format and show me your column names (see question 5 for an example of how I want the tables represented).
    2. xml: Show me the xml file you would use, complete with element tags and the data embedded in these element tags. In question 2 you were just showing me your tags. In this question you are showing me the complete xml file that you would create.
    3. json: Show me the json string you would generate--please do this in a nice, easy-to-read way so that the TA's can easily read your representation.

  5. (20 points) You are given the following two sql tables:

    CourseCatalog
    CourseIdTitleDescriptionCreditHoursLabHoursDepartment
    COSC102Introduction to ProgrammingProblem solving and algorithm development...31EECS
    ECE255Introduction to Logic DesignStandard codes, number systems, base conversions, ...30EECS
    MATH141Calculus 1Single variable calculus especially for students...40Math

    TimeTable
    CourseIdSectionIdDaysStartTimeEndTimeRoomEnrollment
    COSC102001TR11:10:0012:25:00MK 622125
    COSC102002TR14:10:0015:25:00MK 62297
    MATH141005MWF11:15:0012:05:00AY 10535

    Write sql queries to retrieve the following information:

    1. The CourseId and Title of all courses offered by the EECS department.
    2. The CourseId and total enrollment of all courses whose total enrollment is greater than or equal to 200. By total enrollment I mean the combined enrollment for all sections of a course.
    3. The CourseId, SectionId, Title, Description, Days, StartTime, and EndTime of all sections that start after 11:00:00 and end before 15:30:00.

What to Submit

Submit the following files:

  1. answers.txt (questions #1, 2, 4, and 5)
  2. exam.html (question 3)