PHP keyboard input Four student number name Chinese mathematics English information, calculate the average score of each student, output

Source: Internet
Author: User
-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.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.