Challenge: Array Loops
Task
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
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 6
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat
Awesome!
Completion rate improved to 1.67
Challenge: Array Loops
Swipe to show menu
Task
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
Solution
Everything was clear?
Thanks for your feedback!
SectionΒ 5. ChapterΒ 6
single