Javascript Trip planner
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.
I have been trying to solve this but unsuccessful yet. Can someone guide me please?
My Code here
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
var speed = 40;
var time = distance/speed*60;
return time;
}
main();