0
Help, please! Anyone. I need to divide 150 by 40; then I need to multiply the answer by 60 minutes.
You need to plan a road trip. You are traveling at an average speed of 40 miles an hour. Given a distance in miles as input (the code to take input is already present), output to the console the time it will take you to cover it in minutes. Sample Input: 150 Sample Output: 225
2 Réponses
+ 3
At first use the formula for time
Time = Distance / Speed
Time we got is in hours so we will convert it to minutes by multiplying by 60
Time in minutes = Distance/Speed × 60
AND IN JS :
var a = distance/40*60
console.log(a)
0
I tried. In vain. Not working for me.