- 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) }
3 Respuestas
+ 2
distance will be given by program, you don't need to write distance on your own.
+ 1
So i just use the distance to answer thx
0
Ok