Skip to content

Commit cfce63b

Browse files
committed
first commit
0 parents  commit cfce63b

File tree

6 files changed

+79
-0
lines changed

6 files changed

+79
-0
lines changed

.vscode/settings.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"java.project.sourcePaths": ["src"],
3+
"java.project.outputPath": "bin",
4+
"java.project.referencedLibraries": [
5+
"lib/**/*.jar"
6+
]
7+
}

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Getting Started
2+
3+
Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
4+
5+
## Folder Structure
6+
7+
The workspace contains two folders by default, where:
8+
9+
- `src`: the folder to maintain sources
10+
- `lib`: the folder to maintain dependencies
11+
12+
Meanwhile, the compiled output files will be generated in the `bin` folder by default.
13+
14+
> If you want to customize the folder structure, open `.vscode/settings.json` and update the related settings there.
15+
16+
## Dependency Management
17+
18+
The `JAVA PROJECTS` view allows you to manage your dependencies. More details can be found [here](https://github.com/microsoft/vscode-java-dependency#manage-dependencies).

bin/CalculadoraDeMedias.class

1.37 KB
Binary file not shown.

bin/MainM.class

1.1 KB
Binary file not shown.

src/CalculadoraDeMedias.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
import java.util.Scanner;
3+
4+
public class CalculadoraDeMedias {
5+
public static void main(String[] args) {
6+
Scanner scan = new Scanner(System.in);
7+
String[] alunos = {"Camila", "Lucas", "Bruna", "Pedro"};
8+
9+
double media = calculaMediaDaTurma(alunos, scan);
10+
11+
System.out.printf("Média da turma %.1f", media);
12+
}
13+
14+
public static double calculaMediaDaTurma(String[] alunos, Scanner scanner) {
15+
16+
double soma = 0;
17+
for(String aluno : alunos) {
18+
System.out.printf("Nota do aluno %s: ", aluno);
19+
double nota = scanner.nextDouble();
20+
soma += nota;
21+
}
22+
23+
return soma / alunos.length;
24+
}
25+
26+
}
27+

src/MainM.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
public class MainM {
2+
public static void main (String[] args) {
3+
System.out.println("Iniciou do programa no método main.");
4+
a();
5+
System.out.println("Finalizou do programa no método main.");
6+
}
7+
8+
static void a() {
9+
System.out.println("Entrou no método a.");
10+
b();
11+
System.out.println("Finalizou o método a.");
12+
}
13+
14+
static void b() {
15+
System.out.println("Entrou no método b.");
16+
for(int i = 0; i <= 4; i++) System.out.println(i);
17+
c();
18+
System.out.println("Finalizou o método b.");
19+
}
20+
21+
static void c(){
22+
System.out.println("Entrou no método c.");
23+
//Thread.dumpStack();
24+
System.out.println("Finalizou o método c.");
25+
}
26+
27+
}

0 commit comments

Comments
 (0)