Challenge: Array Loops
Taak
Swipe to start coding
Your task is to calculate the total sales for a set of days using a method.
- Create a method
CalculateTotalSalesthat:- Accepts an array of
doublevalues representing daily sales. - Uses a for loop to iterate through the array.
- Calculates the total sum of all sales.
- Returns the total as a
double.
- Accepts an array of
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 6
single
Vraag AI
Vraag AI
Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.
Geweldig!
Completion tarief verbeterd naar 1.25
Challenge: Array Loops
Veeg om het menu te tonen
Taak
Swipe to start coding
Your task is to calculate the total sales for a set of days using a method.
- Create a method
CalculateTotalSalesthat:- Accepts an array of
doublevalues representing daily sales. - Uses a for loop to iterate through the array.
- Calculates the total sum of all sales.
- Returns the total as a
double.
- Accepts an array of
Oplossing
Was alles duidelijk?
Bedankt voor je feedback!
Sectie 5. Hoofdstuk 6
single