Challenge: Fixing the Speed Function
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 50
single
Spørg AI
Spørg AI
Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat
Fantastisk!
Completion rate forbedret til 1.33
Challenge: Fixing the Speed Function
Stryg for at vise menuen
Opgave
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.
Løsning
Var alt klart?
Tak for dine kommentarer!
Sektion 1. Kapitel 50
single