aaa

posted on 25 Aug 2011 14:23 by ryouma
aaa

Comment

Comment:

Tweet

nice post

#3 By inder (14.98.229.19) on 2011-11-02 13:39

<?
$mark = 154;
if($mark > 100)
$grade = "ERROR";
elseif($mark >= 85)
$grade = "A";
elseif($mark>=75)
$grade = "B";
elseif($mark>=65)
$grade = "C";
elseif($mark>=55)
$grade = "D";
elseif($mark>=0)
$grade = "F";
else
$grade = "ERROR";
echo "Compute by If...elseif...else<br>";
echo "    Mark=".$mark." Grade=".$grade."<br><br>";
switch($mark)
{
case $mark>=100;$grade = "ERROR";break;
case $mark>=85;$grade = "A";break;
case $mark>=75;$grade = "B";break;
case $mark>=65;$grade = "C";break;
case $mark>=55;$grade = "D";break;
case $mark>=0;$grade = "F";break;
default;
$grade = "ERROR";
}
echo "Compute by Switch...case<br>";
echo "    Mark=".$mark." Grade=".$grade."<br><br>";
echo "Program by Prasert Adisakwattana 510110404 204202 sec.1<br>";
?>

#2 By osamu on 2011-08-25 14:24

<?
$x=15.12;
$y=-19.72;
$p=pow($x,7)*0.55-15.27*pow($x,5)+68.72*$x/$y+pow(2,5);
echo "X=".$x." and Y=".$y."<br>";
echo "P=X<sup>7</sup>*0.55-15.27*X<sup>5</sup>+68.72*X/Y+2<sup>5</sup>=".$p."<br>";
echo "Program by Prasert Adisakwattana 510110404 204202 sec.1<br>";
?>

#1 By osamu on 2011-08-25 14:24