Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Desafio do iphone e da uml #62

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions Atv_iphone/atv/atv.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$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
9 changes: 9 additions & 0 deletions Atv_iphone/atv/src/Aplicativo/Aparelhotelefonico.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package Aplicativo;

public interface Aparelhotelefonico {
public void ligar(String numero);
public void atender();
public void iniciarCorreioVoz();


}
8 changes: 8 additions & 0 deletions Atv_iphone/atv/src/Aplicativo/NavegadorInternet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package Aplicativo;

public interface NavegadorInternet {
public void exibirpagina(String url);
public void adicionarNovaAba();
public void atualizarPagina();

}
10 changes: 10 additions & 0 deletions Atv_iphone/atv/src/Aplicativo/ReprodutorMusical.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package Aplicativo;



public interface ReprodutorMusical {
public void tocar();
public void pausar();
public void selecionarMusica(String musica);

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

import Aplicativo.NavegadorInternet;
import Aplicativo.ReprodutorMusical;
import Aplicativo.Aparelhotelefonico;

public class Iphone implements Aparelhotelefonico, NavegadorInternet, ReprodutorMusical {
@Override
public void ligar(String numero) {
System.out.println("Ligando para " + numero);
}

@Override
public void atender() {
System.out.println("atendendo ligacao ");
}

@Override
public void iniciarCorreioVoz() {
System.out.println("Iniciando correrio de voz");
}

@Override
public void exibirpagina(String url) {
System.out.println("exibindo pagina " + url);
}

@Override
public void adicionarNovaAba() {
System.out.println("adicionando nova aba");
}

@Override
public void atualizarPagina() {
System.out.println("Atualizando pagina");
}

@Override
public void tocar() {
System.out.println("tocar musica");
}

@Override
public void pausar() {
System.out.println("pausar musica");
}

@Override
public void selecionarMusica(String musica) {
System.out.println("Selecionar musica" + musica);
}
}
35 changes: 35 additions & 0 deletions Atv_iphone/atv/src/Iphone/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package Iphone;

import Aplicativo.Aparelhotelefonico;
import Aplicativo.NavegadorInternet;
import Aplicativo.ReprodutorMusical;
import Iphone.Iphone;



public class Main {
public static void main(String[] args) {
Iphone celular = new Iphone();


ReprodutorMusical musical = celular;
Aparelhotelefonico ligacao = celular;
NavegadorInternet navweb = celular;

System.out.println(" -----LIGACAO----- ");
ligacao.ligar(" 619818181818 ");
ligacao.atender();
ligacao.iniciarCorreioVoz();

System.out.println(" ----Tocar muscia---- ");
musical.selecionarMusica(" Swedish House Mafia ft. Niki & The Dove - Lioness ");
musical.tocar();
musical.pausar();

System.out.println("-----Navegar na web-----");
navweb.exibirpagina(" https://www.porsche.com/brazil/pt/ ");
navweb.adicionarNovaAba();
navweb.atualizarPagina();

}
}
11 changes: 11 additions & 0 deletions DesafioControleFluxo/DesafioControleFluxo.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$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
32 changes: 32 additions & 0 deletions DesafioControleFluxo/src/Contador.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import java.util.Scanner;

public class Contador {
public static void main(String[] args) {
Scanner terminal = new Scanner(System.in);
System.out.println("Digite o primeiro parâmetro");
int parametroUm = terminal.nextInt();
System.out.println("Digite o segundo parâmetro");
int parametroDois = terminal.nextInt();

try {

contar(parametroUm, parametroDois);

} catch (ParametrosInvalidosException e) {
System.out.println(e.getMessage());
}

}

static void contar(int parametroUm, int parametroDois) throws ParametrosInvalidosException {
//validar se parametroUm é MAIOR que parametroDois e lançar a exceção

if (parametroUm >= parametroDois) ;
System.out.println("ATENÇÃO: O NUMERO UM E MENOR QUE O DOIS");
int contagem = parametroDois - parametroUm;
for (int i = 1; i <= contagem; i++) {
System.out.println("o numero e " +i);
//realizar o for para imprimir os números com base na variável contagem
}
}
}
5 changes: 5 additions & 0 deletions DesafioControleFluxo/src/ParametrosInvalidosException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class ParametrosInvalidosException extends Throwable {
public ParametrosInvalidosException(){
super("O segundo parâmetro deve ser maior que o primeiro!!!");
}
}