Student B

[article] [edit page] [discussion] [history]

From Humanitarian-FOSS Project Development Site

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                      "http://www.w3.org/TR/html401/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type"
      content="text/html; charset=iso-8859-1">
  <title>Assignment 1</title>
</head>
<body bgcolor="#ffffff">
    <h1></h1>
    <?php
       /**
        * Assignment 1
        * @author Greg Fedynyshyn <gefed@conncoll.edu>
        * @version 1.0
        */

       /**
        * Associative array containing lyrics indexed by 'day'
        * @var array
        */
        $days["First"] = "A partridge in a pear tree.";
        $days["Second"] = "Two turtle doves.";
        $days["Third"] = "Three french hens.";
        $days["Fourth"] = "For calling birds.";
        $days["Fifth"] = "Five golden rings.";
        $days["Sixth"] = "Six geese a-laying.";
        $days["Seventh"] = "Seven swans a-swimming.";
        $days["Eighth"] = "Eight maids a-milking.";
        $days["Ninth"] = "Nine ladies dancing.";
        $days["Tenth"] = "Ten lords a-leaping.";
        $days["Eleventh"] = "Eleven pipers piping.";
        $days["Twelfth"] = "Twelve drummers drumming.";

       /**
        * Prints out the song
        * @param array $song
        */
        function sing($song) {
                print "\n";
                foreach ($song as $day => $gift) {
                        print "On the {$day} day of christmas, my true love gave to me {$gift}\n";
                }
        }

        sing($days);
  ?>
</body>
</html>
Personal tools