Computer

PHP/Oracle Development


Syllabus
Schedule
Reading
Discussion
Project
Test
Resource
Tip

Class Time: Week 2
(Arrays)

This week, we are focusing our efforts on arrays. Arrays are very important tools that help make our program efficient. In the class notes, we discussed about ways to define, identify and output arrays.

The above basics will get us started. However, there are a lot more into the arrays, in terms of managing, sorting and merging arrays. I am going to use this "Class Time" to expand and supplement what we have done. We will discuss about array sorting this week.

 

Discussion Topic:

In a PHP program, an array called "$student" was defined as follows:

<?php

...

$student = array("London","Tim", "Michael", "Peter", "Tiger", "Clint");

//Sort the $student array and put the sorted results into $sorted.

$sorted=...

...

?>

 

Questions:

  1. If you want to sort the above array ($student) in an ascending order, what will be your exact syntax? In other words, please complete the "$sorted=..." statement in the above code. Please provide your explanation for your function(s) and the parameter(s).
  2. If you want to sort the above array ($student) in an descending order, what will be your exact syntax?

 

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.