Instructiuneaif
-
Upload
alinabacalim -
Category
Documents
-
view
193 -
download
0
Transcript of Instructiuneaif
![Page 1: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/1.jpg)
Material didactic pentru elevii clasei a IX
Elaborat:Bacalîm Alinamasterandă la USB “Alecu Russo”
10.10.2011 desktop:inst_if.ppt
INSTRUCŢIUNEA INSTRUCŢIUNEA CONDIŢIONATĂ IFCONDIŢIONATĂ IF
![Page 2: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/2.jpg)
Cuprins
Formele construcţiei ifConstrucţia if-then-elseConstrucţia if-thenDescifrarea instrucţiunilor sintaxei constr
ucţiei if
Metode de scriere a expresiilor logice
2
![Page 3: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/3.jpg)
Formele construcţiei if
Construcţia if are 2 forme:
If-Then-Else
If-Then
3
![Page 4: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/4.jpg)
Construcţia if-then-else
Sintaxa
Algoritmul de lucru
4
![Page 5: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/5.jpg)
Sintaxa construcţiei if-then-else
IF <condiţie> THEN
Set_1
ELSE
Set_2
END
5
![Page 6: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/6.jpg)
Algoritmul de lucru al construcţiei if-then-else
Calculul conditiei
Conditie
Instructiunea 1 Instructiunea 2
True False
![Page 7: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/7.jpg)
Construcţia if-then
Sintaxa
Algoritmul de lucru
7
![Page 8: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/8.jpg)
Sintaxa construcţiei if-then
IF <condiţie> THEN
Set_1
END
8
![Page 9: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/9.jpg)
Algoritmul de lucru al construcţiei
if-then
Calculul conditiei
Conditie
Instructiunea 1 end
True False
![Page 10: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/10.jpg)
Descifrarea instrucţiunilor sintaxei construcţiei if
10
<condiţie> poate fi:1.Expresie logică;2.Variabilă logică;3.Expresie mixtă;4.Expresie relaţională.
<Set_1> şi <Set_2> reprezintă nişte blocuri de instrucţiuni.
![Page 11: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/11.jpg)
Metode de scriere a expresiilor logice
Multe expresii logice pot fi scrise corect prin diferite metode. Este de dorit ca expresia logică să fie cît mai simplă. Pentru scrierea expresiilor logice în formă simplificată se utilizează 3 metode:
Prima axiomă distributivă; A doua axiomă distributivă; Legile lui Morgan.
11
![Page 12: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/12.jpg)
Prima axiomă de distribuire (P or Q) and (P or R)=P or (Q and R)
12
![Page 13: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/13.jpg)
A două axiomă de distribuire
(P and Q) or (P or R)=P and (Q or R)
13
![Page 14: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/14.jpg)
Legile lui Morgan
(Not P) or (Not Q)= Not (P and Q);
(Not P) and (Not Q)=Not (P or Q);
14
![Page 15: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/15.jpg)
Pagină de ajutor
- Deplasarea la pagina iniţială
- Deplasare la pagina următoare
- Deplasare la pagina precedentă
- Deplasarea la pagina de ajutor
15
![Page 16: Instructiuneaif](https://reader035.fdocumente.com/reader035/viewer/2022070319/557dc9f3d8b42ae4688b4878/html5/thumbnails/16.jpg)
SFÎRŞIT
16