+ 7
I need help with Trip Planner project
Text says: 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 I don't really get this. Also I get test case 1 or 2 but that's not enough. Do I have to get both at same time? Please help and thanks if you do.
25 ответов
0
Siili00 It is very easy, if you use the formula:
time = distance/speed
Tip: remember to convert the time from hours to minutes.
+ 9
This is the right answer 👏
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
const speed = 40;
const time = distance/speed;
const timeInMinutes= time*60;
console.log(timeInMinutes );
}
+ 4
Dede Hurairrah these exercises are meant to test your knowledge.
Try to use the formula:
time = (distance / speed)*60
If you are stuck in some exercise and want some help from the community, then please share your code which you have written in your attempt.
+ 4
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
var speed = 40;
var time = distance / speed;
timeInMinutes = time * 60;
console.log(timeInMinutes);
// using variable all through .
Or
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
let speed = 40;
let time = distance / speed;
timeInMinutes = time * 60;
console.log(timeInMinutes);
// using let ....
+ 1
Ok. Art1mis. Thank you for your attention...
+ 1
This is my code. It works.
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
console.log((distance/40)*60);
}
+ 1
//This worked for me you can try😊
function main() {
var distance =
parseInt(readLine(), 10);
//your code goes here
var speed = 40;
var time = distance/speed*60;
console.log(time);
}
+ 1
console.log(( distance/40)*60 );
0
Can you show me, the complete code for this. Because I don't understand...
0
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
const speed = 40;
const time = distance/speed;
const timeInMinutes = time * 60;
console.log(timeInMinutes)
0
I have writing all the solution you guys made it before but it does't working please help me
0
function main() {
var distance = parseInt(readLine(), 10);
//phung chau quoc
const speed = 40;
const time = distance/speed;
const timeInMinutes= time*60;
console.log(timeInMinutes );
}
0
function main() {
var distance = parseInt(readLine(), 10);
var speed = 40;
var time = distance / speed;
timeInMinutes = time * 60;
console.log(timeInMinutes);
}
0
const speed = 40;
const time = distance/speed;
const timeInMinutes= time*60;
console.log(timeInMinutes );
0
const speed = 40;
const time = distance/speed;
const timeInMinutes= time*60;
console.log(timeInMinutes );
}
0
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
const speed = 40;
const time = distance/speed;
const timeInMinutes = time*60;
console.log(timeInMinutes);
}
0
Hi
0
Thanks for your concern
0
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
const speed = 40;
const time = distance/speed;
const timeInMinutes= time*60;
console.log(timeInMinutes );
}
please follow me
0
Sample Input
78
Sample Output
good