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); }
3 Respuestas
+ 1
I got it thanks man your the best.infact you deserve a follow
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);
}
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