Challenge: Even Number Collector
Oppgave
Swipe to start coding
Calculate the total expenses from a list of daily expenses using a for loop.
- Create a variable named
totaland set it to0.0— this will store the running sum of expenses. - Use a for loop to go through each element in the
expensesarray. - In each iteration, add the current expense to
total. - After the loop finishes, return the
totalvalue.
Løsning
solution.java
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 4
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 9.09
Challenge: Even Number Collector
Sveip for å vise menyen
Oppgave
Swipe to start coding
Calculate the total expenses from a list of daily expenses using a for loop.
- Create a variable named
totaland set it to0.0— this will store the running sum of expenses. - Use a for loop to go through each element in the
expensesarray. - In each iteration, add the current expense to
total. - After the loop finishes, return the
totalvalue.
Løsning
solution.java
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 4
single