A question in java script sheck description for full detail. You need to plan a road trip. You are traveling at an average s... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

A question in java script sheck description for full detail. You need to plan a road trip. You are traveling at an average s...

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 This was my answer pls is there anything wrong with it. function main() { var distance = parseInt(readLine(), 10); //your code goes here var distance = 100; var speed = 40; var partime = 100 / 40; var time = partime * 60; console.log(time) }

22nd Jan 2021, 9:56 PM
Echobravo
3 Answers
+ 2
distance will be given by program, you don't need to write distance on your own.
22nd Jan 2021, 9:59 PM
Abhay
Abhay - avatar
+ 1
So i just use the distance to answer thx
22nd Jan 2021, 10:00 PM
Echobravo
0
Ok
22nd Jan 2021, 9:59 PM
Echobravo