Challenge: Fixing the Speed Function
Tehtävä
Swipe to start coding
Previously, we created a calcSpeed function for calculating the average speed of a car.
Now you need to fix the function so that it can accept values from outside of the function.
- Remove the local variables
distanceandtimeTakeninside the function. - Add two parameters named
distanceandtimeTakeninside the parentheses of thecalcSpeedfunction. - Finally, call the
calcSpeedfunction twice with the corresponding arguments:1000meters,120seconds.1200meters,160seconds.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 50
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Mahtavaa!
Completion arvosana parantunut arvoon 1.33
Challenge: Fixing the Speed Function
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Previously, we created a calcSpeed function for calculating the average speed of a car.
Now you need to fix the function so that it can accept values from outside of the function.
- Remove the local variables
distanceandtimeTakeninside the function. - Add two parameters named
distanceandtimeTakeninside the parentheses of thecalcSpeedfunction. - Finally, call the
calcSpeedfunction twice with the corresponding arguments:1000meters,120seconds.1200meters,160seconds.
Ratkaisu
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 1. Luku 50
single