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

Dev #31

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Dev #31

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
46 changes: 31 additions & 15 deletions desafio.kt
Original file line number Diff line number Diff line change
@@ -1,21 +1,37 @@
// [Template no Kotlin Playground](https://pl.kotl.in/WcteahpyN)
data class User (val name: String, val id: Int, val email: String, val age: Int)

enum class Nivel { BASICO, INTERMEDIARIO, DIFICIL }
data class EducationContent (val name: String, val duration: Int, val description: String)

class Usuario

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

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

val inscritos = mutableListOf<Usuario>()
data class Formation (val name: String, val level: String, var content: MutableList<EducationContent>) {
val registered = mutableListOf<User>()

fun matricular(usuario: Usuario) {
TODO("Utilize o parâmetro $usuario para simular uma matrícula (usar a lista de $inscritos).")
}
fun register(user: User) {
registered.add(user)
println("User ${user.name} registered for the $name formation.")
//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.")
}

//Criando instâncias de EducationContent
val content1 = EducationContent("POO", 60, "Introdução a Orientação a objetos")
val content2 = EducationContent("Design System", 45, "Design System na prática")
val content3 = EducationContent("SGBD", 55, "Banco de dados")

//Criando uma lista de EducationContent
val contentList = mutableListOf(content1, content2, content3)

//Criando uma instância de Formation
val formation = Formation("Backend", "Medio", contentList)

//Criando um usuário
val user = User("Guilherme", 1,"[email protected]", 26)

formation.register(user)

//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.")
}