セクション 1. 章 48
single
Challenge: Fixing the Speed Function
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
Previously, you created a calcSpeed function that calculated the speed of a car using fixed values inside the function.
Now you need to improve the function so that it can accept values from outside.
Your tasks:
- Remove the local variables
distanceandtimeTakenfrom inside the function. - Add two parameters named
distanceandtimeTakenin the function definition. - Calculate the speed using the formula:
Speed = Distance / Time Taken - Return the calculated speed.
- Call the function twice using the following arguments:
1000,1201200,160
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 48
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください