Someone please help me solve the trip planner plus here is the code tell me what I did wrong | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Someone please help me solve the trip planner plus here is the code tell me what I did wrong

function main() { var distance = parseInt(readLine(), 10); //your code goes here var speed=40; var distance=150; var time=(distance/speed); console.log(time*60); }

31st Jul 2022, 9:41 AM
Epicsunrise
Epicsunrise - avatar
3 Answers
+ 1
I got it thanks man your the best.infact you deserve a follow
31st Jul 2022, 11:11 AM
Epicsunrise
Epicsunrise - avatar
0
Please help me solve this trip planner function main() { var distance = parseInt(readLine(), 10); //your code goes here var speed=40; var distance=150; var time=(distance/speed)*60; console.log(time); }
31st Jul 2022, 9:42 AM
Epicsunrise
Epicsunrise - avatar
0
You get distance from input, but than you make same variable distance and set fixed value to 150. Remove this line var distance = 150 Distance is diferent per each text case, and we get this automaticly this is what readLine() do for us
31st Jul 2022, 10:02 AM
PanicS
PanicS - avatar