Algorithme en langage naturel

Réponses à toutes vos questions de la 2nde à la Terminale toutes séries
destroy28
Messages: 9
Enregistré le: 12 Sep 2015, 20:09

Algorithme en langage naturel

par destroy28 » 06 Oct 2015, 21:48

Bon soir a tous,
j'ai réalisé cet algorithme permettant de trouver alpha, beta, deta, la forme canonique... et je dois le traduire en langage naturel et cela me pose problème :hum:
Si vous pouviez me donner quelques pistes ce serait sympa, merci d'avance :we:

1 VARIABLES
2 delta EST_DU_TYPE NOMBRE
3 a EST_DU_TYPE NOMBRE
4 b EST_DU_TYPE NOMBRE
5 c EST_DU_TYPE NOMBRE
6 x0 EST_DU_TYPE NOMBRE
7 x1 EST_DU_TYPE NOMBRE
8 x2 EST_DU_TYPE NOMBRE
9 beta EST_DU_TYPE NOMBRE
10 Alpha EST_DU_TYPE NOMBRE
11 DEBUT_ALGORITHME
12 LIRE a
13 LIRE b
14 LIRE c
15 SI (a==0) ALORS
16 DEBUT_SI
17 AFFICHER "a=0 donc ce n'est pas un trinome du second degré"
18 FIN_SI
19 Alpha PREND_LA_VALEUR -b/(2*a)
20 beta PREND_LA_VALEUR -(pow(b,2)-4*a*c)/4*a
21 AFFICHER "Alpha="
22 AFFICHER Alpha
23 AFFICHER "Beta="
24 AFFICHER beta
25 SI (a==0) ALORS
26 DEBUT_SI
27 FIN_SI
28 SINON
29 DEBUT_SINON
30 delta PREND_LA_VALEUR pow(b,2)-4*a*c
31 AFFICHER "delta="
32 AFFICHER delta
33 SI (delta0) ALORS
49 DEBUT_SI
50 AFFICHER "delta > 0 donc il y a deux solutions:"
51 x1 PREND_LA_VALEUR (-b-sqrt(delta))/(2*a)
52 x2 PREND_LA_VALEUR (-b+sqrt(delta))/(2*a)
53 AFFICHER "x1="
54 AFFICHER x1
55 AFFICHER "x2="
56 AFFICHER x2
57 FIN_SI
58 FIN_SINON
59 FIN_SINON
60 FIN_SINON
61 SI (Alpha0) ALORS
72 DEBUT_SI
73 AFFICHER "la forme canonique est"
74 AFFICHER a
75 AFFICHER "(x-"
76 AFFICHER Alpha
77 AFFICHER ")²"
78 FIN_SI
79 FIN_SINON
80 SI (beta0) ALORS
87 DEBUT_SI
88 AFFICHER "+"
89 AFFICHER beta
90 FIN_SI
91 FIN_SINON
92 FIN_ALGORITHME



Avatar de l’utilisateur
messinmaisoui
Habitué(e)
Messages: 1897
Enregistré le: 24 Oct 2007, 14:52
Localisation: Moselle (57)

par messinmaisoui » 08 Oct 2015, 08:28

Le langage naturel ...
http://mathematiques.daval.free.fr/IMG/pdf/Algo_fiche1_distance.pdf

destroy28 a écrit:...
49 DEBUT_SI
50 AFFICHER "delta > 0 donc il y a deux solutions:"
51 x1 PREND_LA_VALEUR (-b-sqrt(delta))/(2*a)
52 x2 PREND_LA_VALEUR (-b+sqrt(delta))/(2*a)
53 AFFICHER "x1="
54 AFFICHER x1
55 AFFICHER "x2="
56 AFFICHER x2
57 FIN_SI
...


Pour moi le langage naturel (français)
c'est réécrire ton code avec des termes simples
et compréhensibles par tout français
sqrt (square root) par exemple ne parlerait pas à l'épicier du coin ...
=>
Si delta est strictement supérieur à 0 alors
[INDENT]x1 = (-b - racine(delta)) / (2*a)
x2 = (-b + racine(delta)) / (2*a)
Afficher "x1 = " x1
Afficher "x2 = " x2
[/INDENT]
Fin si
Mon avatar me fait peur, est-ce normal docteur ?

 

Retourner vers ✎✎ Lycée

Qui est en ligne

Utilisateurs parcourant ce forum : Aucun utilisateur enregistré et 66 invités

Tu pars déja ?



Fais toi aider gratuitement sur Maths-forum !

Créé un compte en 1 minute et pose ta question dans le forum ;-)
Inscription gratuite

Identification

Pas encore inscrit ?

Ou identifiez-vous :

Inscription gratuite