+ 7

I need help with Trip Planner project

Text says: 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 I don't really get this. Also I get test case 1 or 2 but that's not enough. Do I have to get both at same time? Please help and thanks if you do.

29th Dec 2020, 9:02 AM
Siili00
25 Réponses
0
Siili00 It is very easy, if you use the formula: time = distance/speed Tip: remember to convert the time from hours to minutes.
29th Dec 2020, 9:10 AM
Art1mis
+ 9
This is the right answer 👏 function main() { var distance = parseInt(readLine(), 10); //your code goes here const speed = 40; const time = distance/speed; const timeInMinutes= time*60; console.log(timeInMinutes ); }
16th Apr 2021, 3:30 PM
Anshuman Raj
Anshuman Raj - avatar
+ 4
Dede Hurairrah these exercises are meant to test your knowledge. Try to use the formula: time = (distance / speed)*60 If you are stuck in some exercise and want some help from the community, then please share your code which you have written in your attempt.
31st Dec 2020, 3:38 AM
Art1mis
+ 4
function main() { var distance = parseInt(readLine(), 10); //your code goes here var speed = 40; var time = distance / speed; timeInMinutes = time * 60; console.log(timeInMinutes); // using variable all through . Or function main() { var distance = parseInt(readLine(), 10); //your code goes here let speed = 40; let time = distance / speed; timeInMinutes = time * 60; console.log(timeInMinutes); // using let ....
21st May 2021, 12:20 PM
Adebisi Ola-Adebomi
+ 1
Ok. Art1mis. Thank you for your attention...
31st Dec 2020, 3:48 AM
Game Repentance
Game Repentance - avatar
+ 1
This is my code. It works. function main() { var distance = parseInt(readLine(), 10); //your code goes here console.log((distance/40)*60); }
13th Jun 2021, 5:00 AM
W.W.A. Gayan Malinda
+ 1
//This worked for me you can try😊 function main() { var distance = parseInt(readLine(), 10); //your code goes here var speed = 40; var time = distance/speed*60; console.log(time); }
24th Feb 2022, 11:14 PM
Nana Nyarko
Nana Nyarko - avatar
+ 1
console.log(( distance/40)*60 );
26th Jun 2022, 11:15 PM
Sirwan Qewami
Sirwan Qewami - avatar
0
Can you show me, the complete code for this. Because I don't understand...
30th Dec 2020, 9:06 PM
Game Repentance
Game Repentance - avatar
0
function main() { var distance = parseInt(readLine(), 10); //your code goes here const speed = 40; const time = distance/speed; const timeInMinutes = time * 60; console.log(timeInMinutes)
30th Apr 2021, 4:09 PM
Sheila Martinez
0
I have writing all the solution you guys made it before but it does't working please help me
22nd Jul 2021, 6:32 PM
iskander
0
function main() { var distance = parseInt(readLine(), 10); //phung chau quoc const speed = 40; const time = distance/speed; const timeInMinutes= time*60; console.log(timeInMinutes ); }
15th Aug 2021, 2:40 AM
Phùng Châu Quốc
Phùng Châu Quốc - avatar
0
function main() { var distance = parseInt(readLine(), 10); var speed = 40; var time = distance / speed; timeInMinutes = time * 60; console.log(timeInMinutes); }
19th Aug 2021, 1:58 AM
Sergei Burlak
Sergei Burlak - avatar
0
const speed = 40; const time = distance/speed; const timeInMinutes= time*60; console.log(timeInMinutes );
28th Aug 2021, 8:53 PM
Noor Shomal
Noor Shomal - avatar
0
const speed = 40; const time = distance/speed; const timeInMinutes= time*60; console.log(timeInMinutes ); }
13th Sep 2021, 7:50 PM
Zahangir Alam
Zahangir Alam - avatar
0
function main() { var distance = parseInt(readLine(), 10); //your code goes here const speed = 40; const time = distance/speed; const timeInMinutes = time*60; console.log(timeInMinutes); }
12th Nov 2021, 5:02 AM
Maleesha Kumarasinghe
Maleesha Kumarasinghe - avatar
0
Hi
19th Nov 2021, 5:20 PM
ihewu luke
0
Thanks for your concern
19th Nov 2021, 5:37 PM
ihewu luke
0
function main() { var distance = parseInt(readLine(), 10); //your code goes here const speed = 40; const time = distance/speed; const timeInMinutes= time*60; console.log(timeInMinutes ); } please follow me
24th Jan 2022, 6:12 AM
prateek tiwari
prateek tiwari - avatar
0
Sample Input 78 Sample Output good
7th Apr 2022, 10:04 AM
Mugisha Emmanuel