Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Apprendre Challenge: Fill an Array | Arrays
Introduction to Scala

bookChallenge: Fill an Array

Task

Your task is to create an array of integers of size 20 named testArray and fill it with numbers from 1 to 20 inclusive using a for loop with the loop variable named i to iterate over its indices in a concise way.

Main.java

Main.java

copy
12345678
object Main { def main(args: Array[String]): Unit = { var ___ = new ___[___](___) // Declare an array variable for (___ ___ testArray.___) { ___(___) = ___ // Fill the array } } }

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 3

Demandez à l'IA

expand

Demandez à l'IA

ChatGPT

Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion

Suggested prompts:

Posez-moi des questions sur ce sujet

Résumer ce chapitre

Afficher des exemples du monde réel

Awesome!

Completion rate improved to 2.86

bookChallenge: Fill an Array

Glissez pour afficher le menu

Task

Your task is to create an array of integers of size 20 named testArray and fill it with numbers from 1 to 20 inclusive using a for loop with the loop variable named i to iterate over its indices in a concise way.

Main.java

Main.java

copy
12345678
object Main { def main(args: Array[String]): Unit = { var ___ = new ___[___](___) // Declare an array variable for (___ ___ testArray.___) { ___(___) = ___ // Fill the array } } }

Tout était clair ?

Comment pouvons-nous l'améliorer ?

Merci pour vos commentaires !

Section 4. Chapitre 3
some-alt