+ 1
Need your help on a test case Trip planner !
Hello guys i am totally new on this site ... i love programming but i need help to understand it, can someone help m with the Trip planner case regarding Javascript please 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.
5 Antworten
+ 1
speed = distance / time.
Distance and speed are given, solve formula for time and output the result (in minutes)
If you need help, show your code attempt. This is supernecessary.
0
What help you need here ? It's already explained well in description..
edit:
Calculate time by distance/speed, you get in hours..
Convert the result into minutes..
Print the result...
0
Re-read the lessons and look at the examples.
I gave you the approach in my previous reply.
- 1
Yes but i dont know how to reflect that by coding
the coding start with this:
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
,
- 1
aha thanks Lisa! Let me try