Back to DFS's Workshop Page
Back to Agenda Page


Rectangle Problem II

For this problem, you are to cannibalize any available code (such as the solution to the Rectangle Problem I) and write a trio of scripts which will do the following.

  1. The HTML Page: rect2ask.html
  2. The Driver PHP Script: rect2calc.php
    1. Check the data received to ensure that the values are possible; use die or exit to report problems and terminate execution
    2. Check the length and the width and swap the values if necessary
    3. Report the actual length and width
    4. Call the draw2rect.php script
    5. Report the perimeter, diagonal and area of the rectangle
    6. Report the area of the largest circle which will fit inside the rectangle
  3. The Graphics PHP Script: drawrect2.php
    Using different, coordinated, contrastive colors, draw the following:

To see how this could work, view this possible solution.


© 2005 DFStermole
Created 13 Nov 05
Last Modified 8 Dec 05