+ 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); }

8th Jan 2022, 5:29 PM
Mag Jad
9 Answers
+ 1
What is distance % 150?? hours is distance / speed...
8th Jan 2022, 5:31 PM
Lisa
Lisa - avatar
+ 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"?
8th Jan 2022, 5:37 PM
Lisa
Lisa - avatar
0
I need to find the distance in min
8th Jan 2022, 5:33 PM
Mag Jad
0
It needs to change 3.75 into 225
8th Jan 2022, 5:33 PM
Mag Jad
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
8th Jan 2022, 5:36 PM
Mag Jad
0
Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes.
8th Jan 2022, 5:40 PM
Mag Jad
0
150 is an example for the input distance.
8th Jan 2022, 5:41 PM
Lisa
Lisa - avatar
0
I got it . It would be var hours = distance/40
8th Jan 2022, 5:44 PM
Mag Jad
0
Thank you so much
8th Jan 2022, 5:45 PM
Mag Jad