Difference between revisions of "CSC220 Homework 4 2010"

From dftwiki3
Jump to: navigation, search
(Problem 2)
(Problem 2)
 
(2 intermediate revisions by the same user not shown)
Line 34: Line 34:
 
  x y of bottom-right corner
 
  x y of bottom-right corner
 
  x y of center point
 
  x y of center point
 +
 +
* <font color="magenta">Modification (10/14/10): the file should be stored in a subdirectory of public_html, called '''uploads'''.  You need to make this subdirectory world writable with the command chmod a+rwx uploads so that the http server can write the file when it runs your php program.  Make sure that when you open the file in php, you provide the path as follows: <tt>$fh = fopen( "uploads/data.kml", 'w');</tt></font>
  
 
* Store your program/form in a file called hw4b.php and submit it as follows:
 
* Store your program/form in a file called hw4b.php and submit it as follows:

Latest revision as of 13:55, 14 October 2010

--D. Thiebaut 00:37, 8 October 2010 (UTC)


This assignment is due on Thursday, Oct. 14th, at 11:59 p.m. + 1 minute.

Problem 1

Create an image with Google Docs (or your favorite graphics editor) of the diagram we generated in class this week. Store your diagram in a .jpg, .png or .gif file, so that you can later insert it into a wiki page.

The pictures of the board are available here.

Use the image at the bottom of the page with the photos as an example of what you should emulate.

Remember these simple rules:

  • make it simple
  • be consistent in your use of shapes and colors

Problem 2

  • Go through this Exercise before starting on this problem. It will give you the necessary background.
  • The purpose of this problem is to write a self-reloading php program that will ask the user to enter the following information:
    • an email address
    • the contents of a kml file in a textarea box (or just a subset of the file selected by the user.)
  • The form will keep reloading itself and ask for the information until both pieces of information are entered.
  • The KML information will be copy/pasted by the user in a text-area box.
  • Upon getting both pieces of information, your php program/form will process the coordinates (x, y) in the KML file, and will compute the coordinates of the top-left corner of the rectangle including all the points, the coordinates of the bottom-right corner of the same rectangle, and the coordinates of the center of the rectangle.
  • Once this information is computed, your php program will store the information in a file stored in your public_html directory, and called data.kml. The format of the file should be:
x y of top-left corner
x y of bottom-right corner
x y of center point
  • Modification (10/14/10): the file should be stored in a subdirectory of public_html, called uploads. You need to make this subdirectory world writable with the command chmod a+rwx uploads so that the http server can write the file when it runs your php program. Make sure that when you open the file in php, you provide the path as follows: $fh = fopen( "uploads/data.kml", 'w');
  • Store your program/form in a file called hw4b.php and submit it as follows:
submit hw4 hw4b.php