Computer

PHP/Oracle Development


Syllabus
Schedule
Reading
Discussion
Project
Test
Resource
Tip

Class Time: Week 1
(Control Structure)

This is the first discussion of the semester.

Discussion Topic:

This week, we focus our attention to control structure. For class discussion, we will use do loop as examples to illustrate some of ways to control the program behavior. Before we start the discussion, let us look at the following codes:

Code 1:

<?php

$myVariable = 2;
do {
echo $myVariable;
} while ($myVariable > 3);

?>

 

Code 2:

<?php

$myVariable = 2;
while ($myVariable > 3)
{
echo $myVariable;
}

?>

Code 3:

<?php

$myVariable = 4;
while ($myVariable > 3)
{
echo $myVariable;
}

?>

 

Questions:

  1. What is the result of code 1?
  2. What is the result of code 2?
  3. What is the result of code 3?
  4. One the above codes caused infinite loop, which locked the browser. If you want to make it work only once, how could you modify the code.

You may have to test the codes before you completely understand what is going on.

 

Online Discussion Policy:

1. Discussion Board is the main vehicle for the entire class to have close interactions.  Students are required to actively participate in all discussions.  The total weight of discussion accounts for 25% of the total grade (15% for Class Time Discussion and 10% for Weekly Geeks Corner).

2. Students are supposed to complete discussions by the due date.  Due date policy applies to both discussion, definitely.

3. There will be two major categories of questions to be discussed: instructor-posted, and student-posted.  Students are required to participate in BOTH discussions.

4. Weekly Discussion (Class Time): The instructor-posted questions are intended to facilitate and verify your understanding of the related subject.  The following guidelines will be followed for evaluation.  Each question will have a total of 100 achievable points for the week.

a. Responsiveness to the right question (hit the point). (15 points)

b. Clarity of response. (10 points)

c. Completeness of response. (15 points)

d. Support for response from reading or other resources. (15 points)

e. Correct sentence structure and spelling.  Please use complete sentences and correct English grammar/spelling. By the way, I do not like the language used in text message such as "how r u?"(10 points)

f. Professionalism or Netiquette (no bad languages).

g. Reply to at least one other students' discussions.  (10 points)

h. You have to read at least 50% of the messages posted. (10 points)

i. Do not use such expressions as "I do not know." Offer your insight or suggestions.

j. Have a sense of humor (5 points)

k. Timely bonus: The first 5 students responding to the posted question will receive bonus points in the scale of 10, 8, 6, 4, 2. The first one will receive 10, and the fifth one will have 2 points.