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

Desenvolvimento das funcionalidades #54

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
27 changes: 17 additions & 10 deletions desafio.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
// [Template no Kotlin Playground](https://pl.kotl.in/WcteahpyN)
enum class Nivel { BASICO, INTERMEDIARIO, AVANCADO }

enum class Nivel { BASICO, INTERMEDIARIO, DIFICIL }
data class Usuario(val nome: String)

class Usuario

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

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

val inscritos = mutableListOf<Usuario>()

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

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 kotlinSintaxe = ConteudoEducacional("Kotlin Sintaxe", 120, Nivel.BASICO)
val kotlinMobile = ConteudoEducacional("Kotlin no Mobile", 1000, Nivel.AVANCADO)

val kotlin = Formacao("Kotlin", conteudosKotlin)

val joao = Usuario("João Fernando")

kotlin.matricular(joao)

println(kotlin)
}