Challenge: Calculate Average Temperature
Opgave
Swipe to start coding
Write a program that calculates the average temperature from an array of integers.
- Use a for loop to sum all values in the
tempsarray. - Divide the sum by the number of elements in
tempsto find the average. - Return the average as a
doublevalue.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 6
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 5.56
Challenge: Calculate Average Temperature
Stryg for at vise menuen
Opgave
Swipe to start coding
Write a program that calculates the average temperature from an array of integers.
- Use a for loop to sum all values in the
tempsarray. - Divide the sum by the number of elements in
tempsto find the average. - Return the average as a
doublevalue.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 6
single