+ 1
Trip Planner
HI Team, i have problems with this project if i done the first case right the second is wrong this is my code: function main() { var distance = parseInt(readLine(), 10); //your code goes here var distance = 590; var speed =40; var time = (distance/speed)*60; console.log(time) var distance = 100; var speed=40; var time=(distance/speed)*60; console.log(time); } The output is: 885 150 Pls tell me how i should complete it! BTW now both cases are wrong!
3 ответов
+ 5
U don't need to provide input values....U can just solve it this way....🙂👇🏻
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
var time=(distance/40)*60;
console.log(time);
}
+ 1
Rusu Silviu don't hard code the input values. Take input from the console. The input line is already given for you in the starter code, and you overwrote the input with a hard-coded number. Code Coach will supply the input.
+ 1
Thx for the help!