- 1

distance 150 miles and speed 40mls/h i dont undesrtand how code it to output 225 in console

function main() { var distance = parseInt(readLine(),10);

16th Jan 2021, 9:31 PM
Abdallah benaicha
Abdallah benaicha - avatar
12 Antworten
+ 4
Time taken = 150/40 hours = 3.75 hours = 225 minutes
16th Jan 2021, 10:08 PM
Sonic
Sonic - avatar
+ 4
I'm not sure if this is what you want either. https://code.sololearn.com/cx2ccl4t0iZt/?ref=app
18th Jan 2021, 5:58 AM
Sonic
Sonic - avatar
+ 2
the questions it is travel measured by miles 150 and the speed its 40 mls in hours how code it to input 150 and output 225
16th Jan 2021, 9:40 PM
Abdallah benaicha
Abdallah benaicha - avatar
+ 2
You will have to consider how many minutes are in an hour.
16th Jan 2021, 10:08 PM
Sonic
Sonic - avatar
+ 2
yes but how create a code start by this in top (main ...ect)
16th Jan 2021, 10:10 PM
Abdallah benaicha
Abdallah benaicha - avatar
+ 2
Abdallah benaicha is Swift the language you're after?
18th Jan 2021, 1:21 AM
Sonic
Sonic - avatar
+ 1
Write question in question title not code .And also place your code in description so we can see what you have tried so far.
16th Jan 2021, 9:33 PM
Abhay
Abhay - avatar
+ 1
Sonic 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
16th Jan 2021, 10:13 PM
Abdallah benaicha
Abdallah benaicha - avatar
+ 1
Sonic your work is very beautiful but the code in this exercise start with that .... function main() { var distance = parseInt(readLine(), 10); //your code goes here }
17th Jan 2021, 5:32 PM
Abdallah benaicha
Abdallah benaicha - avatar
+ 1
Sonic the language is Java Script .. thank you so much but the last code don't work like i want and thank you so much for your help
18th Jan 2021, 7:00 AM
Abdallah benaicha
Abdallah benaicha - avatar