JavaScript road trip challenge | Sololearn: Learn to code for FREE!

0

JavaScript road trip challenge

can you plz solve first challenge of JavaScript i did not understand the road trip challenge because it is not letting console how to print plz help me

1/23/2022 4:18:34 PM

Waqar Ahmad Khan

12 Answers

New Answer

+3

Clear your basic fundamentals then you will know everything about it. Here is your code: function main() { var distance = parseInt(readLine(), 10); //your code goes here var minutes = distance /40*60; console.log(minutes) } /// # Note: You need to read the code, too!

+3

Just write this into your code console.log((distance/40) * 60)

+1

Please show your attempt first

+1

function main() { var distance = 40; parseInt(readLine(), 10); //your code goes here var miles = 150; var result = (miles / distance); }

+1

They give me function already

+1

Sorry I forgot ti say can you also post the challenge πŸ˜…

+1

Gahahha ok wait

+1

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

+1

Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes

+1

function main() { var distance = parseInt(readLine(), 10); //your code goes here }

+1

πŸ”₯πŸ…³πŸ…΄πŸ†… πŸ†‚πŸ…·πŸ…ΈπŸ†…πŸ…½πŸ…°πŸ…½πŸ…³πŸ…°πŸ…½ πŸ…ΌπŸ…ΈπŸ†‚πŸ…·πŸ†πŸ…°πŸ”₯ thank you so much brother clear ha

+1

Ahmad Taghavi thank you sloved