セクション 4. 章 3
single
Challenge: for Loop
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Imagine you are buying several items in a shop. Each item costs the same amount, and you want to calculate the total cost of all items.
- Initialize
totalCostto0. - The loop should start with
i = 0and run whilei < quantity. - Add
itemPricetototalCostinside the loop. - Return
totalCostat the end of the method.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 4. 章 3
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください