Please Help | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

Please Help

Somebody should help me with the trip planner I can’t get it

3rd Apr 2021, 11:18 PM
Samuel Okey
10 Answers
+ 1
Samuel Okey This is my code. Hope it will helps you function main() { var distance = parseInt(readLine(), 10); var speed = 40 var time = 60 //your code goes here console.log(distance/speed*time); } Happy coding 👍
4th Apr 2021, 8:50 PM
❤️😍Prerana😍❤️
❤️😍Prerana😍❤️ - avatar
+ 1
Thank you
4th Apr 2021, 12:56 PM
Samuel Okey
+ 1
Solved?
4th Apr 2021, 12:57 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
show. your. attempt. and. which language do you attempted?
3rd Apr 2021, 11:24 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
0
Function main() { var distance = parseInt(readLine(), 10); var distance = 150 var speed = 40 var minutes = distance / speed console.log(minutes *60); }
3rd Apr 2021, 11:32 PM
Samuel Okey
0
Hi! why do you assign the value 150 to the distance variable? the test program itself will substitute the value. this line is superfluous in the code. delete it.
4th Apr 2021, 12:46 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Ok
4th Apr 2021, 12:32 PM
Samuel Okey
0
function main() { var distance = parseInt(readLine(), 10); //your code goes here var distance = 590 var speed= 40 var minutes = distance/speed console.log(minutes * 60) } I dont understand what the 590 come from
4th Apr 2021, 12:44 PM
Samuel Okey
0
remove the distance variable from your code. generally. don't write this line. the distance variable is already declared in the two lines above. these are your input parameters. the test program will assign and insert its own data there. you just need to write the formula and display the result on the screen
4th Apr 2021, 12:53 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Yeah
4th Apr 2021, 1:00 PM
Samuel Okey