Created
December 20, 2012 17:25
-
-
Save valeriu/4346942 to your computer and use it in GitHub Desktop.
Exercice 07 - Numéro 05 (Yan)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<title>Exercice 07 - Numéro 05</title> | |
<meta /> | |
</head> | |
<body> | |
<script> | |
var repA, repB, repC, noQuestion, note, nbBonnesReponses; | |
noQuestion = 1; | |
nbBonnesReponses = 0; | |
repA = window.prompt("Entrez la reponse a la noQuestion no " + noQuestion, ""); | |
if (repA == "b") { | |
window.alert("Bravo!"); | |
nbBonnesReponses++; | |
} else { | |
window.alert("Attention!"); | |
} | |
note = (nbBonnesReponses / noQuestion) * 100; | |
window.alert("Ton cumulatif est de " + note + "%"); | |
noQuestion++; | |
repB = window.prompt("Entrez la reponse a la noQuestion no " + noQuestion, ""); | |
if (repB == "a" || repB == "d") { | |
window.alert("Bravo!"); | |
nbBonnesReponses++; | |
} else { | |
window.alert("Attention!"); | |
} | |
note = (nbBonnesReponses / noQuestion) * 100; | |
window.alert( | |
"Ton cumulatif est de " + note + "%" | |
); | |
noQuestion++; | |
repC = window.prompt("Entrez la reponse a la noQuestion no " + noQuestion, ""); | |
if (repC == "c") { | |
window.alert("Bravo!"); | |
nbBonnesReponses++; | |
} else { | |
window.alert("Attention!"); | |
} | |
note = (nbBonnesReponses / noQuestion) * 100; | |
window.alert( | |
"Ton cumulatif est de " + note + "%" | |
); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment