TP4 - Fichier. Solution de SOUAG Abderrahmane
1) ETUDIANT.TXT
Test
test
15
test1
test1
9
lo
lol
5
abdou
abdou
20
zero
zero
0
zed
zed
10
2) CALCUL.PHP
= 10){
if($c==0){
echo "
Admis
Nom | Prenom | Note |
";
$c = 1;
}
echo " $nom | $prenom | $note |
";
}
}
if ($c == 1){
echo "
";
}
fclose($file);
}
?>
Non admis
Nom | Prenom | Note |
";
$b = 1;
}
echo " $nom | $prenom | $note |
";
}
}
if ($b == 1){
echo "
";
}
fclose($file);
}
?>
3) TRANSFERT.PHP
= 10){
fputs($file1,$nom);
fputs($file1,$prenom);
fputs($file1,$note);
$s=$s+1;
}
}
echo "Le pourcentage est " . round($s/$n,3)*100;
fclose($file);
fclose($file1);
}
?>
4) ADMIS.TXT
Test
test
15
Test
test
15
Test
test
15
Test
test
15
Test
test
15
abdou
abdou
20Test
test
15
abdou
abdou
20
zed
zed
10