Your name:
Starting Date and time:
Ending Date and time:
Statement. I attest that the work on this exam is completely my own
and that the exam was completed in good faith and following the ground
rules that are described herein.
Sign (or type) your name:
Essay Questions (50 points total) Answer the first two questions and
one of the last three. Provide thoughtful, thorough, well-reasoned and
well-written answers. You may use the assigned reading materials
for these questions.
1. What is open source software. Give at least one prominent example
and identify those characteristics that qualify it as open source
software.
2. Make the case that good history can be created using an open source
model. Be sure to identify and counter some of the standard
objections tao this idea.
3. What is the difference between Richard Stallman's concept of
free software and the Open Source Institute's concept of open
source software. What is the significance of this distinction
and what effect, if any, has it had on the development of the
open source movement?
4. What is "open source" about Wikipedia and why is it an important
development in the open source movement? What do contributions
to Wikipedia have in common with contributions to a piece of
open source software?
5. Thomas Goertz has proclaimed that open source is everywhere.
Using specific examples from our readings and class discussions,
describe the limits and prospects of the so-called open source
movement. What are its chief benefits and drawbacks, as you see
them?
PHP Questions (50 points total). You may use the textbook for these
questions. You may NOT use the computer to test your answers. That
is, you must figure out the answers by using logic, arithmetic, and
your understanding of PHP.
1. For each of the following questions, identify exactly what would
be output. You should assume that the output is being sent to a
web page (i.e., and HTML document).
a.
$hello = "Buon giorno";
echo '$hello friend';
b.
$str = "
Fifty";
$str = $str . "
Two";
$str .= "
Skeedoo";
echo "My secret word is $str";
c.
$thingies = array("raindrops on roses", "whiskers on kittens", "warm woolen mittens", "bright copper kettles");
$m = 15 % 2;
$k = 4 - 2 / 1 ;
echo "My favorite things are $thingies[$m] and $thingies[$k]";
d.
function mystery($n) {
while ($n < 100) {
print "$n ";
if ($n % 2 == 0) {
$n += 1;
} else {
$n *= 2;
}
}
}
mystery(3);
mystery(10);
e.
function mystery2($s1, $s2) {
if (strcmp($s1, $s2) == 0) {
echo "\"$s1\" and \"$s2\" are the same";
} else {
echo "\"$s1\" and \"$s2\" are NOT the same";
}
}
mystery2("cat", "Cat");
mystery2("cat", "cat ");
2. Define a function named $printSequence will take two parameters, $m and $n
and will print the values between $m and $n, starting at $m. For example, if
$m is 5 and $n is 10, your function should print 5, 6, 7, 8, 9, 10. On the
other hand if $m is 10 and $n is 5, it should pring 10, 9, 8, 7, 6, 5.
3. Define an associative array named $grades that contains a students' grades for a
computer science class. The grades are for two quizzes, named quiz1, quiz2,
two exams, named exam1, exam2, and a project, named project. The numerical
grades were 85, 82, 91, 71, and 90, respectively. Then write loop to
print a list giving the name of the item and its grade:
quiz1 85
quiz2 82
etc.
4. Write a function named average that has one parameter that
represents an associative array of student grades (like the one in the
previous problem). The function should calculate and return the
average of all the grades in the array. Then show how you would
call the function, pass it an array named $grades, and print
the result, e.g.: "Your average in computer science is 88.2".