Challenge: Autoboxing in Collections
Opgave
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
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 5
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Awesome!
Completion rate improved to 7.14
Challenge: Autoboxing in Collections
Stryg for at vise menuen
Opgave
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
Var alt klart?
Tak for dine kommentarer!
Sektion 3. Kapitel 5
single