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

23rd Jan 2022, 4:18 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
12 Antworten
+ 3
Just write this into your code console.log((distance/40) * 60)
23rd Jan 2022, 8:48 PM
Ahmad Taghavi
Ahmad Taghavi - avatar
+ 1
Please show your attempt first
23rd Jan 2022, 4:19 PM
Kamil Hamid
Kamil Hamid - avatar
+ 1
function main() { var distance = 40; parseInt(readLine(), 10); //your code goes here var miles = 150; var result = (miles / distance); }
23rd Jan 2022, 4:26 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 1
They give me function already
23rd Jan 2022, 4:26 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 1
Sorry I forgot ti say can you also post the challenge 😅
23rd Jan 2022, 5:18 PM
Kamil Hamid
Kamil Hamid - avatar
+ 1
Gahahha ok wait
23rd Jan 2022, 5:20 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 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
23rd Jan 2022, 5:21 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 1
Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes
23rd Jan 2022, 5:21 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 1
function main() { var distance = parseInt(readLine(), 10); //your code goes here }
23rd Jan 2022, 5:22 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
23rd Jan 2022, 5:57 PM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar
+ 1
Ahmad Taghavi thank you sloved
24th Jan 2022, 6:21 AM
Waqar Ahmad Khan
Waqar Ahmad Khan - avatar