セクション 1. 章 45
single
Challenge: Calculating the Speed of a Car
メニューを表示するにはスワイプしてください
タスク
スワイプしてコーディングを開始
If we know the distance a car has traveled and the time it took to cover that distance, we can calculate its average speed using the formula:
Speed = Distance / Time Taken
The distance is measured in meters and the time in seconds.
Use the following values in your calculation: Distance = 1000, Time Taken = 120.
Your tasks:
- Define a function called
calcSpeed. - Declare the variables
distanceandtimeTakeninside the function using the values above. - Calculate the speed using the formula.
- Return the calculated speed.
解答
すべて明確でしたか?
フィードバックありがとうございます!
セクション 1. 章 45
single
AIに質問する
AIに質問する
何でも質問するか、提案された質問の1つを試してチャットを始めてください