as

Write PHP script that will display grade based on criteria given below using the marks obtained in T.Y.Bsc. Examination.

Write PHP script that will display grade based on criteria given below using the marks obtained in T.Y.Bsc. Examination.
a. Distinction (70 and above)  
b. First Class (60 - 69) 
c. Pass (40 - 59)  
d. Fail (below 40) 


Code :-

<?php
    $phy=60;
    $chem=60;
    $math=60;
    $total=$phy+$chem+$math;
    $per=$total/3;
    echo "Physics Mark is $phy<br>";
    echo "Chemistry Mark is $chem<br>";
    echo "Mathematics Mark is $math<br>";
    echo "Total is $total, Percentage is $per<br>";
    if($per>=70)
    {
       echo "Congratulation";
       echo "<br>You get Distinction";
    }
   else if($per>=60)
       echo "First Class";
   else if($per>=40)
       echo "Pass Class";
   else
      echo "You Are Fail";
?>