Assignment 5

Due on Thursday, December 11

Problems (25 points each, total 100 points):

  1. Deitel p. 903, 22.4
      1. Select all authors from the Authors table with the columns in the order lastName, firstName and authorID.
      2. Select a specific author and list all books for that author. Include the title, year and ISBN number. Order the information alphabetically by title.
      3. Add a new author to the Authors table.
      4. Add a new title for an author (remember that the book must have an entry in the AuthorISBN table).
  2. Deitel p. 955, 23.4
  3. Deitel p. 955, 23.5
  4. Deitel p. 955, 23.8

Assignment 4

Due on Wednesday, November 26

Problems (25 points each, total 100 points):

  1. Deitel p. 514, 13.3
    <?xml version = "1.0" encoding = "utf-8"?> 
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"">
    <!-- Fig. 13.3: draw.html -->
    <!-- A simple drawing program ->
    <html xmlns = ""><head>
    <title>Simple Drawing Program</title>
    <style type = "text/css">
    #canvas { width: 400px;
    border: 1px solid #999999;
    border-collapse: collapse}
    td { width: 4px;
    height: 4px }
    th.key { font-family: arial, helvetica, sans-serif;
    font-size: 12px;
    border-bottom: 1px solid #999999 }
    <script type = "text/javascript">
    // initialization inserts cells into the table
    function createCanvas ()
    var side = 100;
    var tbody document.getElementById ("tablebody");
    for (var i = 0; i < side; i++) {
    var row = document.createElement ("tr");
    for (var j = 0; j < side; j++) {
    var cell = document.createElement ("td");
    cell.onmousemove = processMouseMove;
    row.appendChild (cell);
    tbody.appendChild (row);
    } // draws when mouse is moved by turning cells red or blue function processMouseMove (event) { // get IE event if (! event) {event = window.event;} // turn cell blue if Ctrl key is pressed if (event.ctrlKey) { = "blue";} // turn cell red if Shiftkey is pressed if (event.shiftKey) { = "red";} } // --> </script>
    </head> <body onload = "createCanvas()">
    <table id ="canvas" class="canvas"><tbody id="tablebody">
    <tr><th class="key" colspan="1OO">Hold <tt>ctrl</tt>
    to draw blue. Hold <tt>shift</tt> to draw red.</th></tr>
    </body> </html>
  3. Deitel p. 514, 13.6
  4. Deitel p. 587, 14.7
  5. Deitel p. 587, 14.8

Assignment 3

Due on Thursday, October 30

Problems (20 points each, total 100 points):

  1. Deitel p. 486, 12.3 (Use an arbitrary web page, not necessarily Deitel's self-advertising one:)
  2. Deitel p. 486, 12.5
  3. Deitel p. 486, 12.6
  4. Deitel p. 486, 12.7
  5. Deitel p. 486, 12.10
      1. Create a table with 4 rows and 4 columns, either as XHTML elements/tags or using a JavaScript function (see the Chess Board for a similar example). Make sure that the <img> elements in the table cells can be easily identified, e.g. with their row and column index. When the user clicks, a function should be called that performs the necessary shifting of the tiles. I'd recommend to pass the row and column as parameters. Create an array with the urls of all images of the 15 tiles. (You can use these images.) Shuffle the array. (The corresponding function is here.) Assign the src attribute of the <img> elements using the shuffled urls leaving the last empty. Memorize the empty place in global variable(s). So far, it should be quite straightforward.
      2. The shifting function is more complex even though it can be accomplished in less than 10 lines of code (albeit algorithmically a bit demanding ones): Eliminate wrong clicks. Then go from the empty place to the tile clicked shifting the src attribute from the next <img> element to the current one. This is quite similar to going through a linked list or shifting the values in a (sub)array. (You can go the other way, but it's a bit less straightforward...) A challenge: You may think that you need to have two for-loops - one if the shift is within a row and another if it's within a column, but it can be accomplished with just one loop! Finally, don't forget to make the clicked <img>> empty (set its src property to "") and remember the empty place. That's it!

Assignment 2

Due on Friday, October 17

Problems (20 points each, total 100 points):

  1. Deitel p. 357, 9.7
  2. Deitel p. 359, 9.19
  3. Deitel p. 360, 9.28 (includes 9.27)
  4. Deitel p. 360, 9.31 (includes 9.30)
  5. Deitel p. 361, 9.35

Assignment 1

Due on Friday, September 19

See Assignments Policies for submission guidelines.

Problem 1 (30+ points):

Describe the next great idea for a Web N.0 application that will earn you a billion $s!


  1. The application should be feasible, i.e. it can be implemented with the current technology, or with technology that is likely to become available before the end of 2010.
  2. The application should not require more than 5 man-years, i.e. 10 good web programmers/designers should be able to implement it in less than 6 months.
  3. You must be able to describe it on half a page.

Hint: Think of what were such great ideas in the (very recent) past:

  1. Sharing pictures, than videos (Flickr, YouTube)
  2. Social Networking (Facebook, LinkedIn)
  3. Encyclopedia (Wikis)
  4. Free Ads (Craiglist)
  5. Targeted Ads (AdSense/Google)
  6. Auctions (eBay)
  7. etc., etc.

(Most are pretty obvious ideas, and were even then when they were implemented, don't you think so? And, yes some didn't make billions of $s, but they probably would if the authors only wanted it!)

After you submit this assignment, the TA will collect all the submitted ideas and publish them anonymously. Every one of you will then have 3 points to give to ideas that you like most. (You can give all 3 to one idea, or give one point to 3 ideas, or split your points between two ideas. You have to distribute all of your 3 points and cannot give any points to your own idea.) The TA and I can each allocate up to 15 points to each student's idea. We will publish the results. (Of course anonymously.)

Problem 2 (30 points):

Look on the web for a web site of a well known entity (big computer company, famous university, online shopping giant, major search engine, or even a presidential candidate?) which uses XHTML and CSS in their web pages. Download the W3C validators for XHTML and CSS and run a few (+- 10) of their pages through the validator. How do they fare? Look for a web site with many errors. Write a short analysis of the errors. The three students who find the most (sufficiently distinct) errors will get up to 5 bonus points!

Problem 3 (10 points each, total 30 points):

  1. Deitel p. 158, 4.18
  2. Deitel p. 196, 5.8
  3. Deitel p. 196, 5.9