PE1 - Comandos de Decisão
-
Upload
charles-fortes -
Category
Software
-
view
470 -
download
4
description
Transcript of PE1 - Comandos de Decisão
![Page 1: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/1.jpg)
Programação Estruturada I
Prof. Charles Fortes
Comandos de Decisão
![Page 2: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/2.jpg)
Programação Estruturada IProf. Charles Fortes
Sobre o Professor
![Page 3: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/3.jpg)
Programação Estruturada IProf. Charles Fortes
Charles Fortes
![Page 4: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/4.jpg)
Programação Estruturada IProf. Charles Fortes
Charles FortesLíder Técnico na Empresa Prime Systems. Agilista, apaixonado por desenvolvimento (Web, Desktop, Mobile, o que for), pai, amante do Paintball e do Kenjutsu. MTAC - Microsoft Technical Audience Contributor 100Loop - DotNetRaptors
![Page 5: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/5.jpg)
Programação Estruturada IProf. Charles Fortes
Charles Fortes
Líder Técnico na Empresa Prime Systems. Agilista, apaixonado por desenvolvimento (Web, Desktop, Mobile, o que for), pai, amante do Paintball e do Kenjutsu. MTAC - Microsoft Technical Audience Contributor 100Loop - DotNetRaptors
SlideShare: http://pt.slideshare.net/charleswellingtonfortesLinkedin: http://br.linkedin.com/in/charlesfortes/Twitter: @CharlesFortes
![Page 6: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/6.jpg)
Programação Estruturada IProf. Charles Fortes
Charles Fortes
Líder Técnico na Empresa Prime Systems. Agilista, apaixonado por desenvolvimento (Web, Desktop, Mobile, o que for), pai, amante do Paintball e do Kenjutsu. MTAC - Microsoft Technical Audience Contributor 100Loop - DotNetRaptors
Desenvolvimento Web – MVC – Angular.JS – JQuery – SQLServer – MySQL – HTML5 – NoSQL
![Page 7: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/7.jpg)
Programação Estruturada IProf. Charles Fortes
Revisão – if-elsePLT 706 – Capítulo 4 – Páginas 84 a 94
![Page 8: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/8.jpg)
Comando de decisão IF
Programação Estruturada IProf. Charles Fortes
SE ( VERDADE ) ENTÃO FAÇA { ... }
CASO CONTRÁRIO FAÇA { ... }
PLT 706 – Capítulo 4 – Páginas 84 a 94
![Page 9: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/9.jpg)
Programação Estruturada IProf. Charles Fortes
Break e ContinuePLT 706 – Capítulo 4 – Páginas 97 e 98
![Page 10: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/10.jpg)
Programação Estruturada IProf. Charles Fortes
Break e Continue
São usados em loops (FOR, WHILE e DO-WHILE)
O comando break causa a saída imediata do loop, o continue pula o restante do código do loop e volta ao inicio.
![Page 11: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/11.jpg)
Programação Estruturada IProf. Charles Fortes
Break e Continue
![Page 12: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/12.jpg)
Programação Estruturada IProf. Charles Fortes
GoToPLT 706 – Capítulo 4 – Páginas 99
![Page 13: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/13.jpg)
Programação Estruturada IProf. Charles Fortes
GoTo
Faz um desvio de instrução, salta para a linha específica.
for (int i = 0; i < 10; i++){
AumentarTrabalho(empregados[i]);}
goto pula;
While(true) {DarAumento(100.00);
}
pula:printf(“Continua Aqui”);
![Page 14: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/14.jpg)
Programação Estruturada IProf. Charles Fortes
SwitchPLT 706 – Capítulo 4 – Páginas 100 a 103
![Page 15: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/15.jpg)
Programação Estruturada IProf. Charles Fortes
Switch-Case
Seleção entre várias opções.
![Page 16: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/16.jpg)
Para entregar até 12/10/2014 23:59 por e-mailPara entregar até 12/10/2014 23:59 por e-mail
Programação Estruturada IProf. Charles Fortes
![Page 17: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/17.jpg)
Programação Estruturada IProf. Charles Fortes
Code Hunt
• Level 0 + 1
• Encaminhar Print da tela e User
https://www.codehunt.com/
![Page 18: PE1 - Comandos de Decisão](https://reader035.fdocument.pub/reader035/viewer/2022062313/5579a46bd8b42ac1148b49de/html5/thumbnails/18.jpg)
Programação Estruturada I
Prof. Charles Fortes
Dúvidas?