Isabelle Harpin, MATI Montréal Caroline Cormier, Cégep André- Laurendeau /UM
Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.
-
Upload
armelle-coste -
Category
Documents
-
view
104 -
download
0
Transcript of Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.
![Page 1: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/1.jpg)
Lundi, 13 septembre 2010
Algorithmie (cours 2)
Cégep de Saint-Cégep de Saint-HyacintheHyacinthe
Par Hugo St-Louis
![Page 2: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/2.jpg)
Plan
Introduction Condition Opérations simples Conclusion
![Page 3: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/3.jpg)
IntroductionIntroduction
Descartes base le discours Descartes base le discours de la méthode sur 3 points de la méthode sur 3 points fondamentaux fondamentaux :: L'intuition L'intuition La déduction La déduction La modélisation La modélisation
Ce schéma reste encore vrai Ce schéma reste encore vrai en algorithmiqueen algorithmique
![Page 4: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/4.jpg)
IntroductionIntroduction
Programmes précédents (séquence simple d’opérations)
Nous allons maintenant étendre notre langage….et notre logique
![Page 5: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/5.jpg)
Plan
Introduction Condition Opérations simples La structure conditionnelle simple Conclusion
![Page 6: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/6.jpg)
Conditions (Vrai ou Faux)Conditions (Vrai ou Faux)
Condition simple– Exemple :
Hugo est un homme, Pierre à plus de 18 ans
Condition complexe– Exemple :
Hugo est un homme ET il a plus de 18 ans Pierre à plus de 18 ans OU Pierre possède un fausse carte
![Page 7: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/7.jpg)
Conditions (Vrai ou Faux)Conditions (Vrai ou Faux)
Négation Exemple :
– Si je ne suis pas saoul Alors ….
![Page 8: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/8.jpg)
Conditions (Vrai ou Faux)Conditions (Vrai ou Faux)
OU inclusif Exemple :
– Si je ne suis pas saoul OU ma bière est vide Alors ….
![Page 9: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/9.jpg)
Conditions (Vrai ou Faux)Conditions (Vrai ou Faux)
OU exclusif Exemple :
– Si je ne suis pas saoul OU(exclusif) j’ai 20$ dans mes poches Alors ….
![Page 10: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/10.jpg)
Conditions (Vrai ou Faux)Conditions (Vrai ou Faux)
ET Exemple :
– Si je ne suis pas saoul ET ma bière est vide Alors ….
![Page 11: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/11.jpg)
OrdinogrammeOrdinogramme
Nature : Présenter graphiquement une structure conditionnelle …
Condition
Instruction dans le cas du Faux
Instruction dans le cas du Vrai
Faux Vrai
...
![Page 12: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/12.jpg)
Plan
Introduction Condition Opérations simples Conclusion
![Page 13: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/13.jpg)
Opérations simplesOpérations simples
L’affectation : Permet d’affecter à une variable une valeur.
L’affectation se fait à l’aide de l’opérateur « = » L’affectation se fait de la droite vers la gauche.
X = 3
y = « Hugo »
Trouve = Vrai
![Page 14: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/14.jpg)
Opérations simplesOpérations simples
Les opérateurs arithmétiques : Permets d’affecter des opérations arithmétiques sur des valeurs numériques.
![Page 15: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/15.jpg)
Plan
Introduction Condition Opérations simples Conclusion
![Page 16: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/16.jpg)
ConclusionConclusion
Nous avons vu :– Les conditions complexes– Des opérations simples
![Page 17: Lundi, 13 septembre 2010 Algorithmie (cours 2) Cégep de Saint- Hyacinthe Par Hugo St-Louis.](https://reader036.fdocuments.us/reader036/viewer/2022062622/551d9da6497959293b8d78e2/html5/thumbnails/17.jpg)
Question ?Question ?
Merci de votre attentionMerci de votre attention
Est-ce que vous avez Est-ce que vous avez des questions?des questions?
…
Question
Quitter la présentation
Répondre aux questions
Faux Vrai
...