- 3

JavaScript Coding Project

In coding project I've solved the first test, when I'm going to solve next one the code is smashing with the first one, how can divide coding areas?

28th Jan 2022, 7:14 PM
Suren Shahbekyan
14 ответов
+ 3
People can help you much faster when you link your code and explain what you try to do!
28th Jan 2022, 9:22 PM
Lisa
Lisa - avatar
+ 1
JavaScript point 13, there are 5 tests I have solved the first test and don't understand where I will write the second test's code
29th Jan 2022, 5:06 AM
Suren Shahbekyan
+ 1
var distance = 590; var speed =40; var time1= (distance / speed )*60; console.log(time1);
29th Jan 2022, 12:32 PM
Suren Shahbekyan
0
You need to use "distance" variable – do not hard code the input. Do not remove the given code
29th Jan 2022, 8:03 AM
Lisa
Lisa - avatar
0
Did you solve this project? Please can you send me the solution?
29th Jan 2022, 11:33 AM
Suren Shahbekyan
0
I can help you to solve it yourself! Can you please show your code?
29th Jan 2022, 11:34 AM
Lisa
Lisa - avatar
0
function main() { var distance = parseInt(readLine(), 10); //ваш код var distance1 = 590; var speed =40; var time1= (distance1 / speed )*60; console.log(time1); /* var distance2 = 100; var speed =40; var time2= (distance2/ speed )*60; console.log(time2 ); */ }
29th Jan 2022, 11:56 AM
Suren Shahbekyan
0
Use distance, not distance1. distance is the input and you need to use the input to pass all test cases.
29th Jan 2022, 12:00 PM
Lisa
Lisa - avatar
0
How can I use inputs? Where can I see it?
29th Jan 2022, 12:23 PM
Suren Shahbekyan
0
var distance = parseInt(readLine(), 10) is the input. It is already given, use it instead of distance1
29th Jan 2022, 12:27 PM
Lisa
Lisa - avatar
0
???
29th Jan 2022, 12:32 PM
Suren Shahbekyan
0
Where is the second input?
29th Jan 2022, 12:33 PM
Suren Shahbekyan
0
USE var distance = parseInt(readLine(), 10) DO NOT MODIFY THE GIVEN CODE Sololearn will give the input. It can be 590 or any other number. 590 is only an example.
29th Jan 2022, 12:49 PM
Lisa
Lisa - avatar
0
Thank you,😉
29th Jan 2022, 12:59 PM
Suren Shahbekyan