セクション 1. 章 72
single
Challenge: Finding the Average Price of Items
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
You are working at a local electronics store. Your manager has asked you to calculate the average price of all items in stock.
Your tasks:
- Create a variable
totalPriceand set it to0. - Use a
forloop to iterate through all elements of thepricesarray. - Add each price to
totalPrice. - After the loop completes, calculate the average price.
- Return the average value.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 72
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください