+ 1

How will you output to the console the time it will take you to cover it in minutes

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. Explanation: It will take 150/40 = 3.75 hours to cover the distance, which is equivalent to 3.75*60 = 225 minutes. https://code.sololearn.com/WEeiUN5740UL/?ref=app

14th Jan 2021, 7:46 AM
owadokun Tosin Tobi
owadokun Tosin Tobi - avatar
11 Respostas
+ 3
(function time (inp,dis)) //first you create a function { // then you do the basic maths and return it the question already explained and make sure to return it return (inp/dis)*60; } //then console.log the function while you input the values console. log(time(distance,40)); }
14th Jan 2021, 8:12 AM
Ayomide Buluro
Ayomide Buluro - avatar
+ 3
I don't understand why you need to ask how to do this when the question practically provides the answer. But here is a Python example # Enter distance to travel print(int(input())/40*60,'minutes')
14th Jan 2021, 7:56 AM
Rik Wittkopp
Rik Wittkopp - avatar
+ 1
Rik Wittkopp check my code pls
14th Jan 2021, 7:59 AM
owadokun Tosin Tobi
owadokun Tosin Tobi - avatar
+ 1
Don't worry about the inp and dis I just used them for representing
14th Jan 2021, 8:14 AM
Ayomide Buluro
Ayomide Buluro - avatar
+ 1
Had a look & have posted DM Good luck
14th Jan 2021, 8:31 AM
Rik Wittkopp
Rik Wittkopp - avatar
0
Rik Wittkopp I'm not getting it
14th Jan 2021, 7:59 AM
owadokun Tosin Tobi
owadokun Tosin Tobi - avatar
0
align table rows in horizontal form using consol
6th Aug 2021, 5:05 PM
Junior Kenmoe
Junior Kenmoe - avatar
0
on this code class Add { constructor(...words) { this.words = words; } //your code goes here print(){ for(let i of this.words.values()) console.log("
quot;+i+"
quot;); } } var x = new Add("hehe", "hoho", "haha", "hihi", "huhu"); var y = new Add("this", "is", "awesome"); var z = new Add("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing", "elit"); x.print(); y.print(); z.print();
6th Aug 2021, 5:07 PM
Junior Kenmoe
Junior Kenmoe - avatar
0
here is his result $hehe$ $hoho$ $haha$ $hihi$ $huhu$ $this$ $is$ $awesome$ $lorem$ $ipsum$ $dolor$ $sit$ $amet$ $consectetur$ $adipiscing$ $elit$
6th Aug 2021, 5:08 PM
Junior Kenmoe
Junior Kenmoe - avatar
0
I want him to look like this $hehe$hoho$haha$hihi$huhu$ $this$is$awesome$ $lorem$ipsum$dolor$sit$amet$consectetur$adipiscing$elit$
6th Aug 2021, 5:09 PM
Junior Kenmoe
Junior Kenmoe - avatar