-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c82924
commit 51e4d60
Showing
85 changed files
with
1,568 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Saque mínimo | ||
title: Saque Mínimo | ||
subjects: | ||
- algoritmo | ||
areas: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
title: Sequência de Fibonacci | ||
title: Sequência de Fibonacci (String) | ||
subjects: | ||
- algoritmo | ||
areas: | ||
|
29 changes: 0 additions & 29 deletions
29
src/pages/exercises/object-company/_codes/js/response/companiesAddKind.js
This file was deleted.
Oops, something went wrong.
39 changes: 39 additions & 0 deletions
39
src/pages/exercises/object-company/_codes/js/response/index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const companies = [ | ||
{ | ||
name: 'Amazon', | ||
founded: 1994, | ||
industry: ['E-Commerce', 'Cloud'], | ||
}, | ||
{ | ||
name: 'Facebook', | ||
founded: 2004, | ||
industry: ['Social'], | ||
}, | ||
{ | ||
name: 'Alphabet Inc.', | ||
founded: 2015, | ||
industry: ['Search', 'Cloud', 'Advertising'], | ||
}, | ||
]; | ||
|
||
companies.sort((a, b) => a.name.localeCompare(b.name)); | ||
|
||
companies.forEach((company) => { | ||
company.kind = 'Internet company'; | ||
}); | ||
|
||
const MAX_NAME_LENGHT = Math.max( | ||
...companies.map((company) => company.name.length) | ||
); | ||
|
||
function show(companies) { | ||
return companies | ||
.map( | ||
(company) => | ||
company.name.padEnd(MAX_NAME_LENGHT + 3, '.') + company.founded | ||
) | ||
.join('\n'); | ||
} | ||
|
||
// console.table(companies); | ||
console.log(show(companies)); |
23 changes: 0 additions & 23 deletions
23
src/pages/exercises/object-company/_codes/js/response/list-companies.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Objeto HTML Entity | ||
subjects: | ||
- algoritmo | ||
areas: | ||
- objeto | ||
--- | ||
|
||
import { Image } from '@astrojs/image/components'; | ||
import objectHtmlEntity from './_assets/object-html-entity.svg'; | ||
|
||
## Descrição | ||
|
||
Estruture a informação desta coleção de Entidades do HTML com algum tipo de dados, usando objeto: | ||
|
||
| Char | Entity | Decimal | Hexa | Description | | ||
| ------ | -------- | -------- | -------- | -------------- | | ||
| & | `&` | `&` | `&` | ampersand | | ||
| < | `<` | `<` | `<` | less than | | ||
| > | `>` | `>` | `>` | greater than | | ||
| © | `©` | `©` | `©` | copyright sign | | ||
|
||
Para facilitar o processo, observe este diagrama da _Figura 1_: | ||
|
||
_Figura 1 - Objeto Entidade do HTML_ | ||
|
||
<Image src={objectHtmlEntity} alt="Objeto Entidade do HTML" class="border p-4" /> |
13 changes: 13 additions & 0 deletions
13
src/pages/exercises/object-entity/_assets/object-html-entity.pu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@startuml | ||
skinparam classAttributeIconSize 0 | ||
skinparam monochrome true | ||
hide circle | ||
|
||
class Entity { | ||
char: String | ||
entity: String | ||
decimal: String | ||
hexa: String | ||
description: String | ||
} | ||
@enduml |
1 change: 1 addition & 0 deletions
1
src/pages/exercises/object-entity/_assets/object-html-entity.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
src/pages/exercises/object-entity/_assets/object-html-entity.svg:Zone.Identifier
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[ZoneTransfer] | ||
ZoneId=3 | ||
HostUrl=http://www.plantuml.com/plantuml/svg/LOux3W8n34Hxdy97eAPQ2WhgFO7nMiGYSLQE8_4HTmUsGA6SDs-acLgGHoyPsbLj9QU2dAcrGuJhkOUSkDgi3y7Te9HgbPFN8XZU1P8kWgpEMG2sFHujDExu14HEv7kSmzKkdoXRCu15M0lbWIIvqP_Gs7KDhVQZBvZ4bk_pDm00 |
Binary file not shown.
30 changes: 30 additions & 0 deletions
30
src/pages/exercises/object-entity/_codes/js/response/array-companies.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"char": "&", | ||
"entity": "&", | ||
"decimal": "&", | ||
"hexa": "&", | ||
"description": "ampersan" | ||
}, | ||
{ | ||
"char": "<", | ||
"entity": "<", | ||
"decimal": "<", | ||
"hexa": "<", | ||
"description": "less than" | ||
}, | ||
{ | ||
"char": ">", | ||
"entity": ">", | ||
"decimal": ">", | ||
"hexa": ">", | ||
"description": "greater than" | ||
}, | ||
{ | ||
"char": "©", | ||
"entity": "©", | ||
"decimal": "©", | ||
"hexa": "©", | ||
"description": "copyright sign" | ||
} | ||
] |
30 changes: 30 additions & 0 deletions
30
src/pages/exercises/object-entity/_codes/js/response/json-companies.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"amp": { | ||
"char": "&", | ||
"entity": "&", | ||
"decimal": "&", | ||
"hexa": "&", | ||
"description": "ampersan" | ||
}, | ||
"lt": { | ||
"char": "<", | ||
"entity": "<", | ||
"decimal": "<", | ||
"hexa": "<", | ||
"description": "less than" | ||
}, | ||
"gt": { | ||
"char": ">", | ||
"entity": ">", | ||
"decimal": ">", | ||
"hexa": ">", | ||
"description": "greater than" | ||
}, | ||
"copy": { | ||
"char": "©", | ||
"entity": "©", | ||
"decimal": "©", | ||
"hexa": "©", | ||
"description": "copyright sign" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
title: Objeto Exames | ||
subjects: | ||
- algoritmo | ||
areas: | ||
- objeto | ||
--- | ||
|
||
import { Image } from '@astrojs/image/components'; | ||
import objectExams from './_assets/object-exams.svg'; | ||
|
||
## Descrição | ||
|
||
Considere que um professor está construindo um sistema de avaliações no qual as questões possuem peso, então dado que foi criado uma avaliação com estas questões: | ||
|
||
| Questões | Peso | Resposta | | ||
| -------- | ---- | -------- | | ||
| 1 | 2 | a | | ||
| 2 | 2 | b | | ||
| 3 | 2 | a | | ||
| 4 | 2 | c | | ||
| 5 | 2 | d | | ||
|
||
Então se um aluno respondeu a prova com as seguintes alternativas o resultado da nota será 4,0. | ||
|
||
| Questões | Peso | Resposta | Aluno | | ||
| -------- | ---- | -------- | ----- | | ||
| 1 | 2 | a | a | | ||
| 2 | 2 | b | b | | ||
| 3 | 2 | a | b | | ||
| 4 | 2 | c | b | | ||
| 5 | 2 | d | b | | ||
|
||
Para facilitar a criação deste sistema tente criar a classe `Exams` com esta estrutura: | ||
|
||
_Figura 1 - Instância da Empresa_ | ||
|
||
<Image src={objectExams} alt="Instância da Empresa" class="border p-4" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
@startuml | ||
skinparam classAttributeIconSize 0 | ||
skinparam monochrome true | ||
hide circle | ||
|
||
class Exams { | ||
-weight: Weight | ||
-answer: Answer | ||
-exams: Exam | ||
+__construct(answer: Answer, weight: Weight) | ||
+add(exam: Exam): void | ||
+avg(): float | ||
+min([count: float]): Array<float> | ||
+max([count: float]): Array<float> | ||
+lt([limit: float]): Array<float> | ||
+gt([limit: float]): Array<float> | ||
} | ||
@enduml |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ExamCheck { | ||
// TODO | ||
} | ||
|
||
export { ExamCheck }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
class ExamStats { | ||
// TODO | ||
} | ||
|
||
export { ExamStats }; |
47 changes: 47 additions & 0 deletions
47
src/pages/exercises/object-exam/_codes/js/code/exam.print.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
import { ExamCheck } from "./exam-check.js"; | ||
import { ExamStats } from "./exam-stats.js"; | ||
|
||
// Exam Tool | ||
|
||
// calculating grade by weighted average | ||
let weight = { q1: 2, q2: 2, q3: 2, q4: 2, q5: 2 }; | ||
let answer = { q1: "a", q2: "b", q3: "a", q4: "c", q5: "d" }; | ||
let examCheck = new ExamCheck(answer, weight); | ||
|
||
let student = { q1: "a", q2: "b", q3: "b", q4: "b", q5: "b" }; | ||
console.log(examCheck.grade(student)); | ||
console.log(4); | ||
|
||
// calculating grade by weighted average | ||
weight = { q1: 2, q2: 2, q3: 2, q4: 2, q5: 2 }; | ||
answer = { q1: "a", q2: "b", q3: "a", q4: "c", q5: "d" }; | ||
examCheck = new ExamCheck(answer, weight); | ||
|
||
student = { q1: "c", q2: "b", q3: "a", q4: "c", q5: "d" }; | ||
console.log(examCheck.grade(student)); | ||
console.log(8); | ||
|
||
// calculating exam values | ||
let examStats = new ExamStats([ | ||
{ student: "Fulano", grade: 10 }, | ||
{ student: "Sicrano", grade: 5 }, | ||
{ student: "Beltrano", grade: 7 } | ||
]); | ||
|
||
console.log(examStats.avg()); | ||
console.log(7.333333333333333); | ||
|
||
console.log(examStats.min()); | ||
console.log([5]); | ||
|
||
console.log(examStats.min(2)); | ||
console.log([5, 7]); | ||
|
||
console.log(examStats.max()); | ||
console.log([10]); | ||
|
||
console.log(examStats.lt(6)); | ||
console.log([5]); | ||
|
||
console.log(examStats.gt(6)); | ||
console.log([7, 10]); |
Oops, something went wrong.