From 922271fad655bd46c552d83bf434dfe6b486059d Mon Sep 17 00:00:00 2001 From: EduardoHrq Date: Sat, 24 Feb 2024 16:15:00 -0300 Subject: [PATCH] finalizando desafio --- .idea/.gitignore | 3 ++ .idea/aprenda-kotlin-com-exemplos-lab.iml | 12 +++++ .idea/jpa-buddy.xml | 6 +++ .idea/kotlinc.xml | 6 +++ .idea/libraries/KotlinJavaRuntime.xml | 23 +++++++++ .idea/misc.xml | 9 ++++ .idea/modules.xml | 8 +++ .idea/vcs.xml | 6 +++ desafio.kt | 46 ++++++++++++++---- .../.idea/.gitignore | 3 ++ .../.idea/aprenda-kotlin-com-exemplos-lab.iml | 12 +++++ .../.idea/jpa-buddy.xml | 6 +++ .../.idea/kotlinc.xml | 6 +++ .../.idea/libraries/KotlinJavaRuntime.xml | 23 +++++++++ .../.idea/misc.xml | 9 ++++ .../.idea/modules.xml | 8 +++ .../.idea/vcs.xml | 6 +++ .../ConteudoEducacional.class | Bin 0 -> 2908 bytes .../DesafioKt.class | Bin 0 -> 1351 bytes .../Formacao.class | Bin 0 -> 6316 bytes ...enda-kotlin-com-exemplos-lab.kotlin_module | Bin 0 -> 39 bytes .../Nivel.class | Bin 0 -> 1660 bytes .../aprenda-kotlin-com-exemplos-lab/README.md | 10 ++++ .../Usuario.class | Bin 0 -> 964 bytes 24 files changed, 193 insertions(+), 9 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/aprenda-kotlin-com-exemplos-lab.iml create mode 100644 .idea/jpa-buddy.xml create mode 100644 .idea/kotlinc.xml create mode 100644 .idea/libraries/KotlinJavaRuntime.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/.gitignore create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/aprenda-kotlin-com-exemplos-lab.iml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/jpa-buddy.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/kotlinc.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/libraries/KotlinJavaRuntime.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/misc.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/modules.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/.idea/vcs.xml create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/ConteudoEducacional.class create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/DesafioKt.class create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/Formacao.class create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/META-INF/aprenda-kotlin-com-exemplos-lab.kotlin_module create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/Nivel.class create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/README.md create mode 100644 out/production/aprenda-kotlin-com-exemplos-lab/Usuario.class diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/aprenda-kotlin-com-exemplos-lab.iml b/.idea/aprenda-kotlin-com-exemplos-lab.iml new file mode 100644 index 00000000..f392c3c0 --- /dev/null +++ b/.idea/aprenda-kotlin-com-exemplos-lab.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/jpa-buddy.xml b/.idea/jpa-buddy.xml new file mode 100644 index 00000000..966d5f56 --- /dev/null +++ b/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml new file mode 100644 index 00000000..0dd4b354 --- /dev/null +++ b/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/.idea/libraries/KotlinJavaRuntime.xml b/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 00000000..b6883dbc --- /dev/null +++ b/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 00000000..497a6efb --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 00000000..e52c8043 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/desafio.kt b/desafio.kt index f2ebe619..2e1c11af 100644 --- a/desafio.kt +++ b/desafio.kt @@ -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) { +data class Formacao(val nome: String, var conteudos: List, val nivel: Nivel) { + + val inscritos: MutableList = 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() - - 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()) +} \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/.gitignore b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/.gitignore new file mode 100644 index 00000000..26d33521 --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/aprenda-kotlin-com-exemplos-lab.iml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/aprenda-kotlin-com-exemplos-lab.iml new file mode 100644 index 00000000..f392c3c0 --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/aprenda-kotlin-com-exemplos-lab.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/jpa-buddy.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/jpa-buddy.xml new file mode 100644 index 00000000..966d5f56 --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/jpa-buddy.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/kotlinc.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/kotlinc.xml new file mode 100644 index 00000000..0dd4b354 --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/kotlinc.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/libraries/KotlinJavaRuntime.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 00000000..b6883dbc --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/misc.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/misc.xml new file mode 100644 index 00000000..497a6efb --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/misc.xml @@ -0,0 +1,9 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/modules.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/modules.xml new file mode 100644 index 00000000..e52c8043 --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/.idea/vcs.xml b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/vcs.xml new file mode 100644 index 00000000..35eb1ddf --- /dev/null +++ b/out/production/aprenda-kotlin-com-exemplos-lab/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/ConteudoEducacional.class b/out/production/aprenda-kotlin-com-exemplos-lab/ConteudoEducacional.class new file mode 100644 index 0000000000000000000000000000000000000000..9e5596ee05cfcb17f789d408050ac342a533c175 GIT binary patch literal 2908 zcmah~TT>KQ5dO}vm)T*3+2wu{6x3x`TtIRKZy?4sfCiMPgn``|GBZn=my}Qb z1gnylROKO+2OpBEh*qph5q!%}$!|!d(!Db*tE^fDbNZaqm#@3OKKu87fBXqx0wsZ# z8Qb!Va>1T0l=Cug+LkOvAq4adxh=CrX{}|iuWlH5FNy|%$dqZB-g$xc)ZBr>lINJ# z+GK8cSzvI^cGj{RhPUcS({i)YvTRR!pq*;-`#<;l&} z%k{ExUzUp=`Efm`ocC;JUOJnGGwI`uXcVxIfUFtb0u@c5H8p$~Gbyr9TVHE^M>g0R4_JRA!INrni9N`11-sypWIOOspf!-9==?%ClhLdbK#fmd;S3J*( z7vjibfTc^6`nq)2XY2w|qh@IRYD954jv1WPFpDb!i312UV#XR5C_za6Yv`YeE z+gs;>uN~Gvk&@aUt9iqd1?fqOrJ4;JyJV&AC4=dV!9(4(Uopxv>~agiXI{4-e z$*m-l>&Id-Q4OjR)b5ZP)z!sr-|_9eM@@u=bD)cut{o4lje30Vmq;6DOp{D?=$Bg# z(OZuAuh9ri{fP0vC~XyOcZ3>7>@66syl>iPHi-f~i)G6*OGeJxHeHk2dFkLqC+hgb zYo0SLW1(DHHJqE=a&DEKm&Il2n7j`ThhFzpeav5RdSuCy`OSH`6_{yDcG<}rS4?)? z75G>_goegJp+_C`Rrm>~Tn*YqXpPdE}KUxAmK?SF_iv z&DMiv*H-wo#>bGs>7XiSgU0vug{bi=_iwJk0T#QM1v@z7$7L3TpfqY^O7A??kFj2% zl`E5afw4Q!FrJ*)!H4XImgL92+_i&q`tS}e?qK>L2cHqCI*btf;}8J6K>nE#9lp;` zrh4@Lb;kA_bN8ltxRHKIm=G$OF;84)KplZ&fdyQrI|f^#l?ywO&issU=t<@;C_fUB-K|>CAa=4qr3cer_U*_-?zFvWFaSw6@?Jjy;th!JuU)qu! kadE=MNf-St23#C-aooiz7bzFRE*2^}w_MD)$hye?5A*+7cK`qY literal 0 HcmV?d00001 diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/DesafioKt.class b/out/production/aprenda-kotlin-com-exemplos-lab/DesafioKt.class new file mode 100644 index 0000000000000000000000000000000000000000..908fa2a36c20bb89a605715d9030e6249ef91a04 GIT binary patch literal 1351 zcmZux+j0{}5Iv)dB`pGkxFmKi7=jb|BCjFNRX}27J6XK890W=nrz$nt9Xn(1?znbm zUGT*X#}VghSCHL&@hdU?{ex2MpC!75d!as)7nbbL345e{x@GPX<-g7|wT9 zphfJe6*qRcBUQk?3QjQ?OWv*urS?@+#c77In=+94Hp5EGesy_YhcejhSeBjTH1`gD zQ&Pr|@|eqFhsU0#DW9YHh#9C@V*2It#^GdZtalP95*yT?3ae&QRWvhk|6jM_KMH z^{sA?p<<^&!hL`bYj_`*8Rp(1_07Ebu}skw165q5WDla4hmuNvjT|a14_#Ho#|#(W zk}^BnGBAZ{>RXrV-=y#!RWVDo@i~>)i9H@NoF=7t=Cp)u%qJI`bV#eL6$}?zx%PBA z@&?s$9XAr}rzd8o|0vSJui!Hp8Wn4zm&udL+@!{8IxV+3;I|#+x5Y!@A9yNidwfWm-0aED?^9t* zUF8afv$hPxM(htoc%KhFiZpHIaBo1!1km`Sl@&!zSe7G{pH_yk}7dW3KPOz-}Q)@I6Nj(%737+?XM z*lkg~PMnh167B$v8nNu=EU(g6swGNKv6AFr|Kll!ReVRW0)9@{0k&yhB+U1e!P-XA h!d(k%7Hq6r*g((1CVtoki*OHp`W~Si;eLb%{{eXsMo|C& literal 0 HcmV?d00001 diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/Formacao.class b/out/production/aprenda-kotlin-com-exemplos-lab/Formacao.class new file mode 100644 index 0000000000000000000000000000000000000000..ab615b7380196c17cd23cc286d28e080aa00abd9 GIT binary patch literal 6316 zcmeHL`*&2;75?r#@7xT@WI})m3=GMjVJ1T!BoQVUc?8P9Bq~7^sm06W0t1t|aqdit zS}koY+K0Bb^y=&GgPx%bX13F;qE zR_2~__T6W{&bRkIm$(1>>T3Y{@dpX=4!tm`W>nn^NkZV5I<0o+)cld|>kl2%GDR<( z5a**!IEfo6_6#d{HY+ z=-Ves88wsD^J;ErxK>I>S}z>wKBg5971V6r=vMQ2y{Hz+X>^b2#j#Q@HzdK8*C#a@ zJ_#$2>&09)-+gR)vO7!J1xoBr<%P9IHe-0vAfYvLRLdN#7r#dk~oGpN-wYU0lEruJg2G=q6B|`wu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kB6kFwkQgxWwYC1jo;?E$4enL!TK4uW(Z!pcw-g|#zkN-s=EjQ0m;K@T&wGtbvIbMw=rZo|Aw=#TNu+>CXXC-)@ z7{WHjN}#6_G)dflEz=w`+^~qXx`|eVXR%|{Ioy?W2|RZNi2U?9TtAB&lWymrN7#6i zgrqm*y?_G}otk4f62bf+ zuHiLr1I}^%I>)yNq~DVM4%hFpB>WMp@F$Lc;rLgMeQaK|I8L3ijhmeCs6V0eqQn9kkbthe>O|E2MsfP!!iyOP-JWEO}l^wdA?YnULq9 z-7Y<;n>yca^3p`WRXbeR+rnJheumoUV9!H zi_ydxe9JOXR4_N3{)PsM;zx}wFwK+XSt4qsBJUoNvZ!a&Hmfz#z4EZcy zMPHDKr|%PEqMb!;uO*xzZmkw@FGum2FcOPD2e<1?{0%ssgxh&0J`2aFP}jxZdAwv2 zg-Wi&HR}l1k<(&_OK5hOMVQ}xyKPvHVy5JfeD4w^1}z2vB|!ub literal 0 HcmV?d00001 diff --git a/out/production/aprenda-kotlin-com-exemplos-lab/Nivel.class b/out/production/aprenda-kotlin-com-exemplos-lab/Nivel.class new file mode 100644 index 0000000000000000000000000000000000000000..9d43d9c097252d5850ee3a212129e7aebae5a25d GIT binary patch literal 1660 zcmaJ>-*XyO6#nk=W0&o=r8LHnL|ZLYAW~@3_@ksTgb-arh(d~1o-VM(O_tpbyD)u> zFa9Au`KZZ^&Dhal^5`Gsck&mVsQc!2L2A~kblSTYzx zvU?;8w>%P0(20}E%+HEnJ&Fr5OAxHU8gNKI#27g%zt zS*kv+G#HfgOAR+M6N7}e7;d(v;P=`GM#n44c$*mLSdLBMXVRI=78;V6S22eL88ei* zA9?R7!@~d6oVmzlby{1txa$_DuqPBvhZB4kHN1=4f~xl@D?bvI*fYF}O`M8)7b(R< z$Fod3FL-nPHchnDq`PlWPdD>U)fx2i2Zq-kaMO14+_oK$d!|Ej&GBkO%OW%-RjKXQ zbwTL->!WH&BO@rz5<98$#zZ$u4ZXalAqPz;?@=T5+J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