Please Can anyone create code for following problem | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 3

Please Can anyone create code for following problem

Trip Planner 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.

13th May 2022, 2:20 PM
Hacker
19 Answers
+ 3
👉Please tag the relevant programming. 👉Hint: * speed = distance / time * solve formulafor time * output in minutes 👉PLEASE SHOW YOUR CODE ATTEMPT SO WE CAN HELP YOU.
13th May 2022, 2:29 PM
Lisa
Lisa - avatar
+ 2
Now i got my answer thanku prince kumar
13th May 2022, 3:10 PM
Hacker
+ 1
Please can you be my mentor?
13th May 2022, 3:01 PM
Hacker
+ 1
miles = int(input("Distance in miles: ")) answer = (int(miles / 40)) result = (answer * 60) print(result + 45)
14th May 2022, 12:51 AM
Abdullahad
Abdullahad - avatar
0
I try best but i am unable to creat.please guide me
13th May 2022, 2:27 PM
Hacker
0
In this code what is 1.5?
13th May 2022, 2:40 PM
Hacker
0
Please explain what is 60/40? Is it distance/time?
13th May 2022, 2:43 PM
Hacker
0
Is it time/distance? If yes then time/distance is equal to what?
13th May 2022, 2:48 PM
Hacker
0
Please only tell me 60/40 is equal to what ? After that i will never post
13th May 2022, 3:00 PM
Hacker
0
Ok thankx alot
13th May 2022, 3:01 PM
Hacker
0
It would be better if you can specify the programming language in which you want the code Anyway, it gives something like this below in Python # here is the code distance = int(input()) # you could convert it to float if you want time = (distance/40)*60 # calculate and convert time in minutes print (time) I will appreciate other approaches
13th May 2022, 3:01 PM
Moussa Coulibaly
Moussa Coulibaly - avatar
0
Hacker you have to do it step by step as what Lisa showed do these 3 steps with the input you have
13th May 2022, 6:12 PM
learner
learner - avatar
0
Show your code we will show ur errors..
13th May 2022, 9:29 PM
Gaurav Mishra
Gaurav Mishra - avatar
0
public class DivisionPorRestasSucesiva { public static void main(String[] args) { int v =40, d=150, m=60; float t=(float)d/v; float r=t*m; System.out.println(r); } }
14th May 2022, 3:19 AM
Ramón
Ramón - avatar
0
Hacker I finished the course first then went back to complete those extra bits.
14th May 2022, 5:11 AM
Chris Coder
Chris Coder - avatar
0
Hacker it wants you to create 2 variables to store the data. Each variable should equal the formula. Then it wants to output the time in the console.log( )
14th May 2022, 5:15 AM
Chris Coder
Chris Coder - avatar
- 1
function main() { var distance = parseInt(readLine(), 10); //your code goes here console.log(225*3.75) } I tried this code
13th May 2022, 2:31 PM
Hacker
- 1
Anyone are going to help me ? I am beginner but really passion in learning coding
13th May 2022, 2:37 PM
Hacker
- 2
function main() { var distance = parseInt(readLine(), 10); //your code goes here console.log(225*3.75) } Here is my code attempt .i just write console .var was already writen
13th May 2022, 2:32 PM
Hacker