Challenge: Autoboxing in Collections
Oppgave
Swipe to start coding
Implement a method that calculates and returns the average value of all elements in the provided ArrayList
- Complete the method so it uses a loop to sum all values in the input list.
- Calculate the average as a double and return it from the method.
- In the main method, call your method and print the result using this template:
Average value: {average}.
Løsning
solution.java
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Awesome!
Completion rate improved to 7.14
Challenge: Autoboxing in Collections
Sveip for å vise menyen
Oppgave
Swipe to start coding
Implement a method that calculates and returns the average value of all elements in the provided ArrayList
- Complete the method so it uses a loop to sum all values in the input list.
- Calculate the average as a double and return it from the method.
- In the main method, call your method and print the result using this template:
Average value: {average}.
Løsning
solution.java
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 3. Kapittel 5
single