Bu örneğimizde php ile vize ve final norlarının ortalamasını alıp öğrencinin geçip kalma durumunu kontrol eden uygulamayı yazacağız.
Programımız şu şekilde çalışacak.
1- Kullanıcıdan vize ve final notlarını girmesini isteyeceğiz.
2- Vize notunun %40'ını alacağız.
3- Final notunun %60'ını alacağız.
4- Vize ve final notunu toplayacağız.
5- Sonuca göre ekrana metin yazacağız.
Kodlarımız:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Php İle Geçme Kalma Uygulaması</title>
</head>
<body>
<form action="" method="post">
<input type="number" name="vize" placeholder="Vize Notunuzu Giriniz" required>
<input type="number" name="final" placeholder="Final Notunuzu Giriniz" required>
<button type="submit">Hesapla</button>
</form>
</body>
</html>
<?php
if($_POST){
$vize = $_POST['vize'];
$final = $_POST['final'];
if ($vize <0 || $final <0) {
echo "<p style='margin:15px'>Vize veya final notu 0'dan küçük olamaz !</p>";
die;
}
$ortalama = ($vize*0.4)+($final*0.6);
if ($ortalama>50) {
echo "<p style='margin:15px'>Tebrikler Dersi $ortalama ile geçtiniz.</p>";
}else{
echo "<p style='margin:15px'>Maalesef dersten $ortalama ile kaldınız.</p>";
}
}
?>
Hi there, We run an Instagram growth service, which increases your number of followers both safely and practically. - Guaranteed: We guarantee to gain you 400-1200+ followers per month. - Real, human followers: People follow you because they are i
Hi there, We run an Instagram growth service, which increases your number of followers both safely and practically. - We guarantee to gain you 400-1000+ followers per month. - People follow you because they are interested in you, increasing likes,
Buckland
26-August-2022Hi there, Our list contains over 6,500 high authority websites that accept guest posts, saving you hours spent outreaching. The list includes each site's SEO metrics and contact details, allowing you to contact them directly instead of paying overpr