Salut please je voudre la solution de cet exo
serignesaliou
Messages postés
3
Date d'inscription
Statut
Membre
Dernière intervention
-
Templier Nocturne Messages postés 7734 Date d'inscription Statut Membre Dernière intervention -
Templier Nocturne Messages postés 7734 Date d'inscription Statut Membre Dernière intervention -
Question 3 (20 pts)
Voici un algorithme écrit en pseudo-code. Nous vous demandons de compléter les commentaires bligatoires (commentaires de spécification et assertions ) selon votre compréhension de ce que réalise cet algorithme. Vous devez, de plus donner, un titre à chacun des blocs composant l'algorithme. Voici des données que vous pouvez utiliser pour simuler son comportement afin de vous aider à répondre à cette question. Notez bien: les traces de vos simulations ne sont pas demandées.
Algorithme à simuler : Bloc B1: Algorithme à simuler
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Saisie de x et y (voir B2)
arrangement de x et y et obtention de z (voir B3)
le traitement (voir B4)
affichage (voir B5)
fin.
Bloc B2: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Demander x
{A: x est un entier différent de 0}
Demander y
{A: y est un entier }
Fin
Bloc B3: ........
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
z ?FAUX
si (x < 0 ET y < 0) alors
début
x ?-x
y ?y
fin
sinon début
si x < 0 alors
début
x ?-x
z ?VRAI
fin
si y < 0 alors
début
y ?-y
z ?VRAI
fin
fin
fin.
Bloc B4: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
w ?0
v ?y
Tant Que v ?x faire
début
v ?v - x
w ?w + 1
fin
si z = VRAI alors
début
w ?-w
fin
fin
Bloc B5: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Afficher w
Fin
Voici un algorithme écrit en pseudo-code. Nous vous demandons de compléter les commentaires bligatoires (commentaires de spécification et assertions ) selon votre compréhension de ce que réalise cet algorithme. Vous devez, de plus donner, un titre à chacun des blocs composant l'algorithme. Voici des données que vous pouvez utiliser pour simuler son comportement afin de vous aider à répondre à cette question. Notez bien: les traces de vos simulations ne sont pas demandées.
Algorithme à simuler : Bloc B1: Algorithme à simuler
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Saisie de x et y (voir B2)
arrangement de x et y et obtention de z (voir B3)
le traitement (voir B4)
affichage (voir B5)
fin.
Bloc B2: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Demander x
{A: x est un entier différent de 0}
Demander y
{A: y est un entier }
Fin
Bloc B3: ........
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
z ?FAUX
si (x < 0 ET y < 0) alors
début
x ?-x
y ?y
fin
sinon début
si x < 0 alors
début
x ?-x
z ?VRAI
fin
si y < 0 alors
début
y ?-y
z ?VRAI
fin
fin
fin.
Bloc B4: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
w ?0
v ?y
Tant Que v ?x faire
début
v ?v - x
w ?w + 1
fin
si z = VRAI alors
début
w ?-w
fin
fin
Bloc B5: .................
{
objectif: ?
méthode: ?
besoin: ?
connu: ?
entrée: ?
sortie: ?
résultat: ?
hypothèse: ? }
Début
Afficher w
Fin
A voir également:
- Salut please je voudre la solution de cet exo
- Driverpack solution - Télécharger - Divers Utilitaires
- Comment ouvrir un fichier exo ? - Forum Windows
- Mots entre amis messenger solution ✓ - Forum jeux en ligne
- Solution prs chronopost - Forum Mobile
- My sims ds solution ✓ - Forum Jeux vidéo