logo

Crowdly

Browser

Add to Chrome

R1.01 - Initiation au développement

Looking for R1.01 - Initiation au développement test answers and solutions? Browse our comprehensive collection of verified answers for R1.01 - Initiation au développement at moodle.iut-tlse3.fr.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

Que produit le code suivant ?

class Abeille(val nom: String, val espece: String) {

init {

require(this.espece in arrayOf("Apis mellifera", "Bombus")) {

"Espèce non connue."

}

}

}

fun main() {

try {

val z = Abeille("Zoé", "Frelon")

println("OK")

} catch (e: IllegalArgumentException) {

println("INVALIDE")

}

}

View this question

Quelle est la valeur de x après l'exécution de ce code ?

val n = 7

val x = when {

n % 2 == 0 -> n / 2

n > 10 -> n - 5

else -> n * 3

}

View this question

Quelle est la sortie du code suivant ?

fun main() {

val mots = arrayOf("un", "deux", "trois")

for (i in mots.indices) {

print("${mots[i].length} ")

}

}

View this question

Qu'est-ce qu'une classe en programmation orientée objet ?

View this question

Quel affichage produit le code suivant ?

fun main() {

for (i in 3..1) {

print("$i ")

}

println("fin")

}

0%
0%
0%
0%
View this question

Que représente la variable this utilisée dans une méthode en Kotlin ?

View this question

Quelle est la sortie console du programme suivant ?

fun main() {

try {

val s = "jj"

val x = s.toInt()

println(x)

} catch (e: NumberFormatException) {

println("NFE")

}

}

View this question

Quelle est la valeur de result après l'exécution de ce code ?

var n = 1

var result = 1

do {

result *= n

n++

} while (n <= 4)

0%
25%
50%
View this question
Quelle est la principale caractéristique d'un langage compilé par rapport à un langage interprété ?
View this question

Qu'affiche le code suivant ?

val a = 5

val b = 3

val result = if (a > b) {

a * 2

} else {

b * 2

}

println(result)

View this question

Want instant access to all verified answers on moodle.iut-tlse3.fr?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome