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

finalizando desafio #57

Open
wants to merge 1 commit 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
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/aprenda-kotlin-com-exemplos-lab.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/jpa-buddy.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions .idea/libraries/KotlinJavaRuntime.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 37 additions & 9 deletions desafio.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,49 @@
import java.util.function.Predicate
import java.util.stream.Collectors

// [Template no Kotlin Playground](https://pl.kotl.in/WcteahpyN)

enum class Nivel { BASICO, INTERMEDIARIO, DIFICIL }

class Usuario
class Usuario (val name: String)

data class ConteudoEducacional(var nome: String, val duracao: Int = 60)

data class Formacao(val nome: String, var conteudos: List<ConteudoEducacional>) {
data class Formacao(val nome: String, var conteudos: List<ConteudoEducacional>, val nivel: Nivel) {

val inscritos: MutableList<Usuario> = mutableListOf()

fun matricular(vararg usuario: Usuario) {

for (user in usuario) {
inscritos.add(user)
}

}

override fun toString(): String {

val nomeDosConteudos = conteudos.map { c -> c.nome }.toList()

val estudantes = inscritos.map { u -> u.name }.toList()

return "Formacao: {\n" +
" Name: \"${nome}\",\n" +
" Conteudos: {\n" +
" ${nomeDosConteudos}\n" +
" }\n" +
" Nivel: \"${nivel}\"\n" +
" Inscritos: {\n" +
" ${estudantes}\n" +
" }"

val inscritos = mutableListOf<Usuario>()

fun matricular(usuario: Usuario) {
TODO("Utilize o parâmetro $usuario para simular uma matrícula (usar a lista de $inscritos).")
}
}

fun main() {
TODO("Analise as classes modeladas para este domínio de aplicação e pense em formas de evoluí-las.")
TODO("Simule alguns cenários de teste. Para isso, crie alguns objetos usando as classes em questão.")
}
val formacaoKotlin = Formacao("Formacao em kotlin", listOf(ConteudoEducacional("Algoritmos"), ConteudoEducacional("POO Kotlin")), Nivel.BASICO)

formacaoKotlin.matricular(Usuario("Eduardo"), Usuario("Cathiely"))

println(formacaoKotlin.toString())
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions out/production/aprenda-kotlin-com-exemplos-lab/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions out/production/aprenda-kotlin-com-exemplos-lab/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
10 changes: 10 additions & 0 deletions out/production/aprenda-kotlin-com-exemplos-lab/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Aprenda Kotlin Com Exemplos: Desafio de Projeto (Lab)

Desafio de Projeto criado para avaliação do conteúdo técnico explorado no repositório [aprenda-kotlin-com-exemplos](https://github.com/digitalinnovationone/aprenda-kotlin-com-exemplos). **Nesse contexto, iremos abstrair o seguinte domínio de aplicação:**

**A [DIO](https://web.dio.me) possui `Formacoes` incríveis que têm como objetivo oferecer um conjunto de `ConteudosEducacionais` voltados para uma stack tecnológica específica, preparando profissionais de TI para o mercado de trabalho. `Formacoes` possuem algumas características importantes, como `nome`, `nivel` e seus respectivos `conteudosEducacionais`. Além disso, tais experiências educacionais têm um comportamento relevante ao nosso domínio, definido pela capacidade de `matricular` um ou mais `Alunos`.**


```kotlin
TODO("Crie uma solução em Koltin abstraindo esse domínio. O arquivo [desafio.kt] te ajudará 😉")
```
Binary file not shown.