Skip to content

Commit f2200e7

Browse files
committed
feat (small challenges): new small challenges static
1 parent ac0e683 commit f2200e7

3 files changed

Lines changed: 125 additions & 1 deletion

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Todos os exemplos no diretório `notebook` são preparados para o ambiente Jupyt
88
## Abrir branch específico em uma instância do [binderhub](https://github.com/jupyterhub/binderhub)
99

1010
* Última versão testada e estável:
11-
[![launch @ mybinder.org][badge-jupyterlab-mybinder-org]](https://mybinder.org/v2/gh/santanche/java2learn/v1.1.3?urlpath=lab)
11+
[![launch @ mybinder.org][badge-jupyterlab-mybinder-org]](https://mybinder.org/v2/gh/santanche/java2learn/v1.1.4?urlpath=lab)
1212

1313
* Última versão disponível:
1414
[![launch @ mybinder.org][badge-jupyterlab-mybinder-org]](https://mybinder.org/v2/gh/santanche/java2learn/master?urlpath=lab)
Lines changed: 124 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,124 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "markdown",
5+
"id": "white-worcester",
6+
"metadata": {},
7+
"source": [
8+
"# Small Challenges 2\n",
9+
"\n",
10+
"Tente descobrir o resultado de cada um dos programas abaixo, depois o execute para ver se confere com o que você supôs.\n",
11+
"\n",
12+
"## Parte 1"
13+
]
14+
},
15+
{
16+
"cell_type": "code",
17+
"execution_count": null,
18+
"id": "broadband-memorial",
19+
"metadata": {},
20+
"outputs": [],
21+
"source": [
22+
"public class Combinado {\n",
23+
" private static int a = 0;\n",
24+
" private int b = 0;\n",
25+
" \n",
26+
" public Combinado(int a, int b) {\n",
27+
" this.a = a;\n",
28+
" this.b = b;\n",
29+
" }\n",
30+
" \n",
31+
" public void incrementa() {\n",
32+
" a++;\n",
33+
" b++;\n",
34+
" System.out.println(\"a: \" + a + \"; b: \" + b);\n",
35+
" }\n",
36+
"}"
37+
]
38+
},
39+
{
40+
"cell_type": "code",
41+
"execution_count": null,
42+
"id": "special-swift",
43+
"metadata": {},
44+
"outputs": [],
45+
"source": [
46+
"Combinado c1 = new Combinado(5, 5),\n",
47+
" c2 = new Combinado(7, 7);\n",
48+
"\n",
49+
"c1.incrementa();\n",
50+
"c2.incrementa();\n",
51+
"c1.incrementa();\n",
52+
"c2.incrementa();"
53+
]
54+
},
55+
{
56+
"cell_type": "markdown",
57+
"id": "greater-arabic",
58+
"metadata": {},
59+
"source": [
60+
"# Parte 2"
61+
]
62+
},
63+
{
64+
"cell_type": "code",
65+
"execution_count": null,
66+
"id": "crude-quantity",
67+
"metadata": {},
68+
"outputs": [],
69+
"source": [
70+
"public class Combinado {\n",
71+
" private static int a = 0;\n",
72+
" private int b = 0;\n",
73+
" \n",
74+
" public Combinado(int a, int b) {\n",
75+
" this.a = a;\n",
76+
" this.b = b;\n",
77+
" }\n",
78+
" \n",
79+
" public void incrementa() {\n",
80+
" a++;\n",
81+
" b++;\n",
82+
" System.out.println(\"a: \" + a + \"; b: \" + b);\n",
83+
" }\n",
84+
" \n",
85+
" public static void variosIncrementos(int n) {\n",
86+
" for (int v = 1; v <= n; v++)\n",
87+
" this.incrementa();\n",
88+
" }\n",
89+
"}"
90+
]
91+
},
92+
{
93+
"cell_type": "code",
94+
"execution_count": null,
95+
"id": "civic-freight",
96+
"metadata": {},
97+
"outputs": [],
98+
"source": [
99+
"Combinado c1 = new Combinado(5, 5),\n",
100+
" c2 = new Combinado(7, 7);\n",
101+
"\n",
102+
"c1.variosIncrementos(2);\n",
103+
"c2.variosIncrementos(3);"
104+
]
105+
}
106+
],
107+
"metadata": {
108+
"kernelspec": {
109+
"display_name": "Java",
110+
"language": "java",
111+
"name": "java"
112+
},
113+
"language_info": {
114+
"codemirror_mode": "text/x-java",
115+
"file_extension": ".java",
116+
"mimetype": "",
117+
"name": "Java",
118+
"nbconverter_exporter": "",
119+
"version": "1.8.0_121"
120+
}
121+
},
122+
"nbformat": 4,
123+
"nbformat_minor": 5
124+
}

notebooks/pt/c02oo-java/s10small-challenges/s01tarefa/small-challenges-02.ipynb renamed to notebooks/pt/c02oo-java/s10small-challenges/s01tarefa/small-challenges-03.ipynb

File renamed without changes.

0 commit comments

Comments
 (0)