Challenge: Calculate Average Temperature
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6
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 5.56
Challenge: Calculate Average Temperature
Sveip for å vise menyen
Oppgave
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
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 6
single