http://php.flashwebhost.com/vineesh/...n_making_3.php
and my code is as follows:
Code:
<?php
$passMark = 35;
$student1Name = 'Manu';
$student1Mark = 34;
$student2Name = 'Saritha';
$student2Mark = 60;
$student3Name = 'Sudhi';
$student3Mark = 93;
$class1 = 'First Class';
$class2 = 'Distinction';
echo 'Passmark = ' . $passMark . '<br> <br>' ;
echo 'Student names with marks <br> <br>';
echo $student1Name . ' = ' . $student1Mark . ' marks. <br>' ;
echo $student2Name . ' = ' . $student2Mark . ' marks. <br>' ;
echo $student3Name . ' = ' . $student3Mark . ' marks. <br> <br>' ;
if ($student1Mark < $passMark) {
echo $student1Name . ', you have got only ' . $student1Mark . ' marks and you are failed. <br>' ;
}
if ($student2Mark > $passMark) {
echo $student2Name . ', you have got ' . $student2Mark. ' marks and you passed with ' . $class1 . '<br>' ;
}
if ($student3Mark > $passMark) {
echo 'Congratulations ! ' . $student3Name . '!. You have got ' . $student3Mark . ' marks and you passed with ' . $class2 ;
}
Bookmarks