how to calculate grade results in php -


this code calclate normal result example

  • if 1200 marks of student showing grade
  • if 1100 marks of student showing nothing
  • if 800 marks of student showing b grade

but want this

  • if marks 1200 showing grade
  • if marks less 1200 grade showing b
  • if marks less 800 showing grade c

how can please me fix issue thanks

<?php     $calculate="$marks";     switch ($calculate)     {     case "1200":        echo "a";        break;     case "800":        echo "b!";        break;     case "600":        echo "c";        break;     default:        echo "";     }     ?> 

<?php $calculate = $marks;  if ($calculate < 800) {     echo "c"; } else if ($calculate < 1200) {     echo "b!"; } else if ($calculate == 1200) {     echo "a"; } ?> 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -