Skip to content

Commit dd5c4a3

Browse files
committed
first commit
0 parents  commit dd5c4a3

File tree

14 files changed

+179
-0
lines changed

14 files changed

+179
-0
lines changed

.idea/.gitignore

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/description.html

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/encodings.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/modules.xml

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/project-template.xml

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/runConfigurations.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<h1>Debugging Java</h1>
2+
3+
4+
<h2>🔎 Referências Bibliográficas</h2>
5+
<ul>
6+
<li>https://www.hostgator.com.br/blog/debug-desenvolvimento-web/</li>
7+
<li>https://www.alura.com.br/conteudo/java-excecoes</li>
8+
<li>https://confluence.jetbrains.com/display/IntelliJIDEA/14.+Depurador</li>
9+
<li>https://www.eclipse.org/community/eclipse_newsletter/2017/june/article1.php</li>
10+
<li>https://www.youtube.com/watch?v=1bCgzjatcr4</li>
11+
</ul>
12+
13+
<h2> 🤝 Contribuindo </h2>
14+
15+
Este repositório foi criado para fins de estudo, então contribua com ele.
16+
Se te ajudei de alguma forma, ficarei feliz em saber. E caso você conheça alguém que se identidique com o conteúdo, não deixe de compatilhar.
17+
18+
Se possível:
19+
20+
⭐️ Star o projeto
21+
22+
🐛 Encontrar e relatar issues
23+
24+
25+
------------
26+
27+
Disponibilizado com ♥ por [cami-la](https://www.linkedin.com/in/cami-la/ "cami-la").

debugging-java.iml

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$">
6+
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
</component>
11+
</module>
Binary file not shown.

romances-blake-crouch.txt

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Romances Blake Crouch
2+
3+
Abandon (July 7, 2009)
4+
Famous (April 15, 2010)
5+
Snowbound (June 22, 2010)
6+
Run (February 24, 2011)
7+
Eerie (with Jordan Crouch (June 7, 2012)
8+
Dark Matter (July 26, 2016)
9+
Good Behavior (November 15, 2016)
10+
Recursion (June 11, 2019)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package br.com.dio.debbuging;
2+
3+
import java.util.*;
4+
5+
public class CalculadoraDeMedias {
6+
public static void main(String[] args) {
7+
Scanner scan = new Scanner(System.in);
8+
List<String> alunos = Arrays.asList("Camila", "João", "Lucas", "Bruna", "Pedro", "Maria");
9+
10+
Map<String, Integer> alunosENotas = pedirNotasDosAlunos(alunos, scan);
11+
System.out.println(alunosENotas);
12+
13+
//System.out.println("Média: " + calcularMediaDaTurma(alunosENotas));
14+
15+
//mostraAClassificacaoDosAlunos(alunosENotas);
16+
}
17+
18+
private static double calcularMediaDaTurma(Map<String, Integer> alunosESuasNotas) {
19+
20+
return alunosESuasNotas.values().stream()
21+
.mapToDouble(m -> m.doubleValue())
22+
.average()
23+
.orElse(0);
24+
25+
}
26+
27+
private static void mostraAClassificacaoDosAlunos(Map<String, Integer> alunosESuasNotas) {
28+
Set<Map.Entry<String, Integer>> entries = alunosESuasNotas.entrySet();
29+
30+
List<String> aprovados = new ArrayList<>();
31+
List<String> reprovados = new ArrayList<>();
32+
List<String> recuperacao = new ArrayList<>();
33+
34+
entries.forEach(alunoENota -> {
35+
if (alunoENota.getValue() > 7) aprovados.add(alunoENota.getKey());
36+
else if (alunoENota.getValue() < 5) reprovados.add(alunoENota.getKey());
37+
else recuperacao.add(alunoENota.getKey());
38+
});
39+
40+
System.out.println("Aprovados: " + aprovados);
41+
System.out.println("Reprovados: " + reprovados);
42+
System.out.println("Recuperação: " + recuperacao);
43+
}
44+
45+
46+
private static Map<String, Integer> pedirNotasDosAlunos(List<String> alunos, Scanner scan) {
47+
Map<String, Integer> alunosEnotas = new TreeMap<>();
48+
49+
/*for (String aluno : alunos) {
50+
System.out.printf("Média do aluno %s: ", aluno);
51+
alunosEnotas.put(aluno, scan.nextInt());
52+
}
53+
54+
return alunosEnotas;*/
55+
56+
// Map<String, Integer> alunosEnotas = new TreeMap<>();
57+
58+
alunos.forEach(aluno -> {
59+
System.out.printf("Média do aluno %s: ", aluno);
60+
alunosEnotas.put(aluno.toString(), scan.nextInt());
61+
});
62+
63+
return alunosEnotas;
64+
}
65+
66+
}

src/br/com/dio/debbuging/Main.java

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package br.com.dio.debbuging;
2+
3+
public class Main {
4+
public static void main(String[] args) {
5+
System.out.println("Início do método main.");
6+
metodo1();
7+
System.out.println("Fim do método main.");
8+
}
9+
10+
private static void metodo1() {
11+
System.out.println("Início do método1.");
12+
metodo2();
13+
System.out.println("Fim do método1.");
14+
}
15+
16+
private static void metodo2() {
17+
System.out.println("Início do médodo2.");
18+
for(int i = 0; i <= 4; i++)
19+
System.out.println(i);
20+
System.out.println("Fim do método2");
21+
}
22+
}

0 commit comments

Comments
 (0)