Skip to content

Instantly share code, notes, and snippets.

@valeriu
Created December 20, 2012 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save valeriu/4346942 to your computer and use it in GitHub Desktop.
Save valeriu/4346942 to your computer and use it in GitHub Desktop.
Exercice 07 - Numéro 05 (Yan)
<?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