La présentation est en train de télécharger. S'il vous plaît, attendez

La présentation est en train de télécharger. S'il vous plaît, attendez

Exercice : Remplir un tableau.

Présentations similaires


Présentation au sujet: "Exercice : Remplir un tableau."— Transcription de la présentation:

1 Exercice : Remplir un tableau.
1°) On veut créer l’algorithme permettant à notre calculatrice de remplir le tableau suivant des images des X par la fonction f définie par f(X) = 2X + 3W : X = 5 6 7 si W = 3 si W = 5

2 Chaque ligne du tableau sera remplie par :
W+1→W X+1→X 2→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non

3 Chaque ligne du tableau sera remplie par :
W+1→W X+1→X 2→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non

4 puis il faudra faire varier W par :
W+1→W X+1→X 2→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non Partie du Programme me donnant tous les X et Y pour chaque W

5 puis il faudra faire varier W par :
W+2→W X+1→X 2→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non

6 puis il faudra faire varier W par :
W+2→W X+1→X 1→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non « Afficher W » me permettra de vérifier à chaque affichage d’un W que je dois remplir une ligne entière du tableau, cette action n’est pas obligatoire.

7 Programme : Lbl1 W+2→W Lbl2 X+1→X Lbl3 Lbl4
1→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non

8 Programme : Lbl1 W+2→W Lbl2 X+1→X Lbl Lbl4 1→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non 1 → W : Lbl 1 : W + 2 W : W → X : Lbl 2 : X + 1 → X : 2X + 3W → Y : Y If X = 7 : Then Goto 3 : Else Goto 2 : Lbl 3 : If W = 5 : Then Goto 4 : Else Goto 1 : Lbl 4 : « Fin »

9 Exercice : Remplir tout tableau.
2°) On veut créer l’algorithme permettant à notre calculatrice de remplir tout tableau du type suivant des images des X par la fonction f définie par f(X) = 2X + 3W : X = 14 17 20 etc… 113 si W = 2 si W = 6 si W = 10 si W = 50

10 Les X sont définis par un Xmini et un Xmaxi
et un Pas ΔX pour aller d’un Xn à Xn+1 . Les W sont définis par un Wmini et un Wmaxi et un Pas ΔW pour aller d’un Wn à Wn+1 . Il faut donc en informer la machine. +4 14 = Xmini 17 20 etc… 113 = Xmaxi Wmini = 2 si W = 6 si W = 10 Wmaxi= 50

11 Les X sont définis par un Xmini et un Xmaxi
et un Pas ΔX pour aller d’un Xn à Xn+1 . Les W sont définis par un Wmini et un Wmaxi et un Pas ΔW pour aller d’un Wn à Wn+1 . X : de A à B avec un Pas de C. W : de D à E avec un Pas de F. C C C F A = Xmini etc… B = Xmaxi Wmini = D Wmaxi= E

12 X : de A à B avec un Pas de C. W : de D à E avec un Pas de F.
Lbl1 W+2→W Lbl2 X+1→X Lbl Lbl4 1→W Afficher W →X 2X+3W→Y X=7 W= «Fin» Afficher Y oui oui non non 1 → W : Lbl 1 : W + 2 W : W → X : Lbl 2 : X + 1 → X : 2X + 3W → Y : Y If X = 7 : Then Goto 3 : Else Goto 2 : Lbl 3 : If W = 5 : Then Goto 4 : Else Goto 1 : Lbl 4 : « Fin »

13 X : de A à B avec un Pas de C. W : de D à E avec un Pas de F.
Lbl1 W+F→W Lbl2 X+C→X Lbl Lbl4 Saisir Afficher W A-C→X 2X+3W→Y X=B W=E «Fin» A, B et C Afficher Y oui oui D, E et F non non D-F→W ? → A : ? → B : ? → C : ? → D : ? → E : ? → F : D - F → W : Lbl 1 : W + F W : W A - C → X : Lbl 2 : X + C → X : 2X + 3W → Y : Y If X = B : Then Goto 3 : Else Goto 2 : Lbl 3 : If W = E : Then Goto 4 : Else Goto 1 : Lbl 4 : « Fin »

14 Exemple : Remplir ce tableau.
34 39 44 si W = 11 si W = 19 si W = 27

15 Exemple : Remplir ce tableau.
X : de A=29 à B=44 avec un Pas de C=5. W : de D=11 à E=27 avec un Pas de F=8. X = 29 34 39 44 si W = 11 si W = 19 si W = 27

16 Exemple : Remplir ce tableau.
X : de A=29 à B=44 avec un Pas de C=5. W : de D=11 à E=27 avec un Pas de F=8. X = 29 34 39 44 si W = 11 91 101 111 121 si W = 19 si W = 27

17 Exemple : Remplir ce tableau.
X : de A=29 à B=44 avec un Pas de C=5. W : de D=11 à E=27 avec un Pas de F=8. X = 29 34 39 44 si W = 11 91 101 111 121 si W = 19 115 125 135 145 si W = 27

18 Exemple : Remplir ce tableau.
X : de A=29 à B=44 avec un Pas de C=5. W : de D=11 à E=27 avec un Pas de F=8. X = 29 34 39 44 si W = 11 91 101 111 121 si W = 19 115 125 135 145 si W = 27 139 149 159 169


Télécharger ppt "Exercice : Remplir un tableau."

Présentations similaires


Annonces Google