Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 51 additions & 0 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions controle-fluxo.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/codigo-fonte/tipos-variaveis/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
68 changes: 68 additions & 0 deletions desafios/Iphone/Diag_Iphone.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<mxfile host="Electron" agent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/29.6.6 Chrome/144.0.7559.236 Electron/40.8.4 Safari/537.36" version="29.6.6">
<diagram name="Página-1" id="2nvcy-qIdD594aqppe2q">
<mxGraphModel dx="1830" dy="2027" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<mxCell id="H5qhLa2XW5veeh9WnH8K-1" parent="1" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Iphone" vertex="1">
<mxGeometry height="52" width="140" x="200" y="250" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-8" edge="1" parent="1" source="H5qhLa2XW5veeh9WnH8K-1" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;exitX=1;exitY=1;exitDx=0;exitDy=0;" value="">
<mxGeometry relative="1" width="80" as="geometry">
<mxPoint x="400" y="440" as="sourcePoint" />
<mxPoint x="480" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-10" edge="1" parent="1" source="H5qhLa2XW5veeh9WnH8K-1" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;exitX=0;exitY=1;exitDx=0;exitDy=0;entryX=0.688;entryY=0.004;entryDx=0;entryDy=0;entryPerimeter=0;" value="dispatch">
<mxGeometry relative="1" width="80" x="-1" y="-330" as="geometry">
<mxPoint x="-330" y="-330" as="offset" />
<mxPoint x="-10" y="440" as="sourcePoint" />
<mxPoint x="56.319999999999936" y="440.44000000000005" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-12" edge="1" parent="1" source="H5qhLa2XW5veeh9WnH8K-1" style="html=1;verticalAlign=bottom;endArrow=block;curved=0;rounded=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" value="">
<mxGeometry relative="1" width="80" as="geometry">
<mxPoint x="230" y="439" as="sourcePoint" />
<mxPoint x="270" y="440" as="targetPoint" />
</mxGeometry>
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-15" parent="1" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Phone" vertex="1">
<mxGeometry height="104" width="140" x="-30" y="440" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-16" parent="H5qhLa2XW5veeh9WnH8K-15" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ ligar(): void" vertex="1">
<mxGeometry height="26" width="140" y="26" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-17" parent="H5qhLa2XW5veeh9WnH8K-15" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ atender(): void" vertex="1">
<mxGeometry height="26" width="140" y="52" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-18" parent="H5qhLa2XW5veeh9WnH8K-15" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ iniciarCorreioVoz: void" vertex="1">
<mxGeometry height="26" width="140" y="78" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-19" parent="1" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="MusicPlayer" vertex="1">
<mxGeometry height="104" width="180" x="180" y="440" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-20" parent="H5qhLa2XW5veeh9WnH8K-19" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ tocar(): boolean" vertex="1">
<mxGeometry height="26" width="180" y="26" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-21" parent="H5qhLa2XW5veeh9WnH8K-19" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ pausa(): boolean" vertex="1">
<mxGeometry height="26" width="180" y="52" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-22" parent="H5qhLa2XW5veeh9WnH8K-19" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ selecionarMusica(): void" vertex="1">
<mxGeometry height="26" width="180" y="78" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-23" parent="1" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=26;fillColor=none;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" value="Browser" vertex="1">
<mxGeometry height="104" width="190" x="410" y="440" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-24" parent="H5qhLa2XW5veeh9WnH8K-23" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ exibirPagina(): void" vertex="1">
<mxGeometry height="26" width="190" y="26" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-25" parent="H5qhLa2XW5veeh9WnH8K-23" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ adicionarNovaAba(): void" vertex="1">
<mxGeometry height="26" width="190" y="52" as="geometry" />
</mxCell>
<mxCell id="H5qhLa2XW5veeh9WnH8K-26" parent="H5qhLa2XW5veeh9WnH8K-23" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=top;spacingLeft=4;spacingRight=4;overflow=hidden;rotatable=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;whiteSpace=wrap;html=1;" value="+ atualizarPagina(): void" vertex="1">
<mxGeometry height="26" width="190" y="78" as="geometry" />
</mxCell>
</root>
</mxGraphModel>
</diagram>
</mxfile>
20 changes: 20 additions & 0 deletions desafios/Iphone/src/controller/Browser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package controller;

public class Browser {

private int abas = 1;

public void exibirPagina(String url){
System.out.printf("Mostrando site %s %n", url);
}

public void adicionarNovaAba(){
abas += 1;
System.out.printf("Criando aba %d %n", abas);
}

public void atualizarPagina(){
System.out.println("Atualizano pagina...");
System.out.println("Pagina atualizada");
}
}
26 changes: 26 additions & 0 deletions desafios/Iphone/src/controller/MusicPlayer.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package controller;

public class MusicPlayer {

private boolean play = false;

public MusicPlayer(){super();}

public MusicPlayer(boolean play){
super();
this.play = play;
}

public boolean tocar(){return play = true;}

public boolean pausa(){return play;}

public void selecionarMusica(String music){
if (play) {
System.out.printf("playing %s %n", music);
} else {
System.out.printf("Music %s selected %n", music);
}
}

}
20 changes: 20 additions & 0 deletions desafios/Iphone/src/controller/Phone.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package controller;

public class Phone {

public Phone(){super();}

public void ligar(String numero){
System.out.printf("Ligando para %s %n", numero);
}

public void atender(){
System.out.println("Atendendo ligacao");
}

public void iniciarCorreioVoz(){
System.out.println("Iniciando correio de voz...");
System.out.println("Gravando mensagem...");
}

}
27 changes: 27 additions & 0 deletions desafios/Iphone/src/main/Iphone.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package main;

import controller.Browser;
import controller.Phone;
import controller.MusicPlayer;

public class Iphone {

static void main() {

Phone caller = new Phone();
MusicPlayer spotify = new MusicPlayer();
Browser fireFox = new Browser();

caller.iniciarCorreioVoz();
caller.ligar("21 99900-1234");
caller.atender();

spotify.tocar();
spotify.selecionarMusica("Guerra & Pace, Pollo e Brace");

fireFox.exibirPagina("youtube.com");
fireFox.atualizarPagina();
fireFox.adicionarNovaAba();
}

}
29 changes: 29 additions & 0 deletions desafios/controle-fluxo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
### IntelliJ IDEA ###
out/
!**/src/main/**/out/
!**/src/test/**/out/

### Eclipse ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Mac OS ###
.DS_Store
3 changes: 3 additions & 0 deletions desafios/controle-fluxo/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions desafios/controle-fluxo/.idea/git_toolbox_prj.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions desafios/controle-fluxo/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions desafios/controle-fluxo/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading