Can anyone pls drop a guide to solve then first JavaScript task | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone pls drop a guide to solve then first JavaScript task

Trip Planner

6th Aug 2022, 8:34 PM
Adedeji Abdulahi
2 Answers
0
Post your attempt
6th Aug 2022, 9:49 PM
Chigozie Anyaeji 🇳🇬
Chigozie Anyaeji 🇳🇬 - avatar
0
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 Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes. My attempt: function main() { var distance = parseInt(readLine(), 10); let hours= distance/'average speed' minutes= hours * 60 console.log(minutes) }
6th Aug 2022, 9:54 PM
Adedeji Abdulahi