-Keyboard input Four student number name Chinese mathematics English information, calculate the average score of each student, output
-The student's information includes the school number name Chinese mathematics English average score, 4 student's information in the array.
$student=Array();$student=Array(Array(' name '=' A ',' Chinese '= the,' Math '= the,' 中文版 '= -,' avg '=''),Array(' name '=' B ',' Chinese '= -,' Math '= -,' 中文版 '= -,' avg '=''),Array(' name '=' C ',' Chinese '= -,' Math '= -,' 中文版 '= the,' avg '=''),Array(' name '=' d ',' Chinese '= -,' Math '= -,' 中文版 '= -,' avg '=''), );//Calculate average score for($i=0;$i
$student);
$i++){
$total=
$student[
$i][
' Chinese ']+
$student[
$i][
' 中文版 '];
$total+=
$student[
$i][
' Math '];
$student[
$i][
' avg ']=
$total/
3; }
//Output
for(
$i=
0;
$i
<>
$student);
$i+ +) { echo
' name '.
' ='. $student [ $i]
[ ' name '].
' Chinese '.
' ='. $student [ $i]
[ ' Chinese '].
' math '.
' ='. $student [ $i]
[ ' math '].
' 中文版 '.
' ='. $student [ $i]
[ ' 中文版 '].
' avg '.
' ='. $student [ $i]
[ ' avg ']. '
'; }
'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
'). Text (i)); }; $numbering. FadeIn (1700); }); });</span></span>
The above is introduced in PHP keyboard input four students of the name of the language math English information, calculate the average performance of each student, output, including the content, I hope that the PHP tutorial interested in a friend helpful.