Sectionย 1. Chapterย 50
single
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ย 1. Chapterย 50
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat