28 Ocak 2014 Salı

PHP-Not ortalaması bulma (Else-if deyimi ile )

 
 


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name=”author” Content=”Cüneyt KORKUSUZ” />
<title>Ortalama Hesaplama</title>
</head>
 
<body>
<form id="form1" name="form1" method="post" action="">
  <table width="467" border="1" align="center" cellpadding="1" cellspacing="1">
    <tr>
      <td colspan="2" align="center"><strong>NOT ORTALAMASI HESAPLAMA</strong></td>
    </tr>
    <tr>
      <td width="217" height="35">1.yazılıyı giriniz</td>
      <td width="237"><label for="kutu1"></label>
      <input type="text" name="kutu1" id="kutu1" /></td>
    </tr>
    <tr>
      <td height="36">2.yazılıyı giriniz</td>
      <td><label for="kutu2"></label>
      <input type="text" name="kutu2" id="kutu2" /></td>
    </tr>
    <tr>
      <td height="37">3.yazılıyı giriniz</td>
      <td><label for="kutu3"></label>
      <input type="text" name="kutu3" id="kutu3" /></td>
    </tr>
    <tr>
      <td height="34">1.performans notunu giriniz</td>
      <td><input type="text" name="kutu4" id="textfield5" /></td>
    </tr>
    <tr>
      <td height="37">1.uygulama notunu giriniz</td>
      <td><input type="text" name="kutu5" id="textfield4" /></td>
    </tr>
    <tr>
      <td height="40" colspan="2" align="center"><input type="submit" name="buton" id="buton" value="hesapla" /></td>
    </tr>
    <tr>
      <td>Sonuç==</td>
      <td>
      <?php
                 $yazili1=$_POST["kutu1"];
                  $yazili2=$_POST["kutu2"];
                  $yazili3=$_POST["kutu3"];
                   $performans=$_POST["kutu4"];
                               $uygulama=$_POST["kutu5"];
                               
                               $ort=($yazili1+$yazili2+$yazili3+$performans+$uygulama)/5;
                               
                              if($ort>84.99)
                              {
                                            echo "Puanı=".$ort."=="."Notu=5";
                                           
                                            }
                                           
                              elseif($ort>69.99)
                              {
                                            echo "Puanı=".$ort."=="."Notu=4";
                                           
                                            }
                                           
                              elseif($ort>59.99)
                              {
                                            echo "Puanı=".$ort."=="."Notu=3";
                                           
                                            }
                                           
                              elseif($ort>44.99)
                              {
                                            echo "Puanı=".$ort."=="."Notu=2";
                                           
                                            }
                                            elseif($ort>=0)
                              {
                                            echo "Puanı=".$ort."=="."Notu=1";
                                           
                                            }
                                           
                                            else
                                            {
                                                           echo "Yanlış veri girişi";
                                                           }
                
                
                 ?>
     
     
      &nbsp;</td>
    </tr>
  </table>
</form>
</body>
</html>

Hiç yorum yok :

Yorum Gönder

Yorumunuz uygun bulunduğu takdirde en kısa zamanda yayınlanacaktır.