Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

PHP Code statements PHP Code statements Code statements that will calculate and

ID: 649506 • Letter: P

Question

PHP Code statements

PHP Code statements Code statements that will calculate and display a student?s assignment marks, year mark (VM), portfolio mark (PM), exam mark (EM) and final mark (FM). The FM is calculated as follows: three assignments scores (e.g. 20/100, 40/100 and 50/100 marks) contribute equally towards the YM (out of 100). Both the PM and EM also count out of 100. The YM contributes 30% to the FM, the PM contributes 25%, and the EM 45%. Use echo statements with HTML tags and marks of your choice to neatly display the AM, VM, PM, EM and the FM to the student. Also provide the full date that the record is accessed (i.e. the day/month/year the page is viewed by the student).

Explanation / Answer

<html>
   <body>

       <?php
           $as1=80;
           $as2=70;
           $as3=60;
           $pm=70;
           $em=80;
          
           $ym=($as1+$as2+$as3)/3
          
           fm = ($ym*30/100) + ($pm*25/100) + ($em*45/100)

          
           echo "AM = ".($as1+$as2+$as3);
           echo "YM = ".$ym;
           echo "PM = ".$pm;
           echo "EM = ".$em;
           echo "FM = ".$fm;
       ?>
   </body>
</html>