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

DesafiosConcluidos-danidantas7227 #82

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
10 changes: 10 additions & 0 deletions desafios/controle-fluxo/DesafioControleFluxo/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions desafios/controle-fluxo/DesafioControleFluxo/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DesafioControleFluxo</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
package Controller;

import java.util.Scanner;

public class Contador {
public static void main(String[] args) {

Scanner input = new Scanner(System.in);

System.out.println("Informe o primeiro parâmetro:");
int parametroUm = input.nextInt();

System.out.println("\nInforme o segundo parâmetro:");
int parametroDois = input.nextInt();


try {
contar(parametroUm, parametroDois);

}catch(ParametrosInvalidosException e) {
System.out.println("\nO segundo parâmetro deve ser maior que o primeiro!");
}

input.close();
}


public static void contar(int parametroUm, int parametroDois) throws ParametrosInvalidosException {

if (parametroUm > parametroDois ) {throw new ParametrosInvalidosException();}else {

int contagem = parametroDois - parametroUm;

for(int i = 1; i <= contagem; i++) {
System.out.println("Imprimindo o número " + i);
}
System.out.println("\nObtivemos " + contagem + " ocorrências!");


}
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package Controller;

@SuppressWarnings("serial")
public class ParametrosInvalidosException extends Exception {

public ParametrosInvalidosException() {
super("ERROR: Segundo Paramêtro é maior que o primeiro!!!");
}


}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package Controller;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
*
*/
/**
* @author 55219
*
*/
module DesafioControleFluxo {
}
10 changes: 10 additions & 0 deletions desafios/poo/DesafioIphone/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions desafios/poo/DesafioIphone/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DesafioIphone</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
14 changes: 14 additions & 0 deletions desafios/poo/DesafioIphone/.settings/org.eclipse.jdt.core.prefs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
23 changes: 23 additions & 0 deletions desafios/poo/DesafioIphone/src/Controller/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package Controller;

import Model.*;

public class Main {

public static void main(String[] args) {

Iphone iphoneDan = new Iphone("Iphone XR", "Apple", "IOS", 0001);

iphoneDan.ligar("21 97728-0000");
iphoneDan.atender();
iphoneDan.iniciarCorreioVoz();

iphoneDan.exibirPagina("https://github.com/digitalinnovationone/trilha-java-basico/tree/main/desafios/poo");
iphoneDan.adicionarNovaAba();
iphoneDan.atualizarPagina();

iphoneDan.selecionarMusica("twenty one pilots - Ride");
iphoneDan.tocar();
iphoneDan.pausar();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package Controller;
64 changes: 64 additions & 0 deletions desafios/poo/DesafioIphone/src/Model/AparelhoTelefonico.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
package Model;

public class AparelhoTelefonico {

private String nome, marca, sistemaOperacional;
private int id;


public AparelhoTelefonico(String nome, String marca, String sistemaOperacional, int id) {
super();
this.nome = nome;
this.marca = marca;
this.sistemaOperacional = sistemaOperacional;
this.id = id;
}


public String getNome() {
return nome;
}


public void setNome(String nome) {
this.nome = nome;
}


public String getMarca() {
return marca;
}


public void setMarca(String marca) {
this.marca = marca;
}


public String getSistemaOperacional() {
return sistemaOperacional;
}


public void setSistemaOperacional(String sistemaOperacional) {
this.sistemaOperacional = sistemaOperacional;
}


public int getId() {
return id;
}


public void setId(int id) {
this.id = id;
}


public void ligar(String numero) { System.out.println("\nLigando para " + numero + " ..."); }

public void atender() { System.out.println("\nAtendendo Celular..."); }

public void iniciarCorreioVoz() { System.out.println("\nIniciando o Correio de voz..."); }

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

public class Iphone extends AparelhoTelefonico implements ReprodutorMusical, NavegadorInternet {

private String musica = "música";

public Iphone(String nome, String marca, String sistemaOperacional, int id) {
super(nome, marca, sistemaOperacional, id);
}

public String getMusica() {
return musica;
}

@Override
public void selecionarMusica(String musica) {
this.musica = musica;
System.out.println("\n" + musica + " selecionada...");
}

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

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

@Override
public void exibirPagina(String url) {
System.out.println("\nExibindo a Página " + url + " ...");
}

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

@Override
public void atualizarPagina() {
System.out.println("\nAtualizando página...");
}







}
11 changes: 11 additions & 0 deletions desafios/poo/DesafioIphone/src/Model/NavegadorInternet.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package Model;

public interface NavegadorInternet {

public abstract void exibirPagina(String url);

public abstract void adicionarNovaAba();

public abstract void atualizarPagina();

}
11 changes: 11 additions & 0 deletions desafios/poo/DesafioIphone/src/Model/ReprodutorMusical.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package Model;

public interface ReprodutorMusical {


public abstract void selecionarMusica(String musica);

public abstract void tocar();

public abstract void pausar();
}
1 change: 1 addition & 0 deletions desafios/poo/DesafioIphone/src/Model/package-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package Model;
9 changes: 9 additions & 0 deletions desafios/poo/DesafioIphone/src/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
*
*/
/**
* @author 55219
*
*/
module DesafioIphone {
}
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions desafios/sintaxe/DioContaBanco-danidantas7227/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions desafios/sintaxe/DioContaBanco-danidantas7227/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>DioContaBanco</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Loading