Simplifier un algorithme à 2 niveaux

Views:
 
     
 

Presentation Description

No description available.

Comments

Presentation Transcript

Simplifier un algorithme à 2 niveaux d’imbrication : 

Copyright Léon Lévy 2001-2008 Simplifier un algorithme à 2 niveaux d’imbrication

Simplifier un algorithme à 2 niveaux d’imbrication : 

Copyright Léon Lévy 2001-2008 Simplifier un algorithme à 2 niveaux d’imbrication Cet algorithme calcule le total de toutes les commandes d’un magasin

Simplifier un algorithme à 2 niveaux d’imbrication : 

Copyright Léon Lévy 2001-2008 Simplifier un algorithme à 2 niveaux d’imbrication Cet algorithme calcule le total de toutes les commandes d’un magasin Total magasin = 0 Lire Commandes Pour tout rayon (même rayon) Faire Total rayon = 0 Afficher Total rayon T1 : Total magasin + Total rayon Fin traitement des rayons Afficher Total magasin

Simplifier un algorithme à 2 niveaux d’imbrication : 

Copyright Léon Lévy 2001-2008 Simplifier un algorithme à 2 niveaux d’imbrication Cet algorithme calcule le total de toutes les commandes d’un magasin et le total par rayon : Total magasin = 0 Lire Commandes Pour tout rayon (même rayon) Faire Total rayon = 0 Pour toute commande du rayon Faire T2 : Total rayon + Montant de la commande Lire Commandes Fin traitement du rayon Afficher Total rayon T1 : Total magasin + Total rayon Fin traitement des rayons Afficher Total magasin

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme 1ère partie : les structures Structure Rayon ? T1

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme 2ème partie : les flux ? T1

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ? T1 ? Calcule et affiche un total pour le Magasin

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ? T2 ? Calcule et affiche un total par Rayon

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme Exécution T1 ? ?

La solution à 2 niveaux sans algorithme : 

Copyright Léon Lévy 2001-2008 La solution à 2 niveaux sans algorithme ? ? Lire Commandes Pour toute commande Faire Lire Commandes Fin traitement des commandes Partie « Flux » de l’algorithme … T1 Total magasin + Montant de la commande Partie « Structure » de l’algorithme T2 : Total magasin + Montant de la commande pour ce magasin …

Slide 17: 

Copyright Léon Lévy 2001-2008 FIN