+ 1
What did I do wrong
I need to do the trip planner function main() { var distance = parseInt(readLine(), 10); //your code goes here var hours = distance % 150/40; var minutes = hours * 60; console.log(minutes); }
9 Respuestas
+ 1
What is distance % 150?? hours is distance / speed...
+ 1
speed = distance / time, hence
time = distance / speed.
distance and time are given
So what does 150 mean? And do you mean by "distance in min"?
0
I need to find the distance in min
0
It needs to change 3.75 into 225
0
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
0
Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes.
0
150 is an example for the input distance.
0
I got it . It would be var hours = distance/40
0
Thank you so much