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?
1/28/2022 7:14:18 PM
Suren Shahbekyan14 Answers
New AnswerJavaScript 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
You need to use "distance" variable – do not hard code the input. Do not remove the given code
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 ); */ }
Use distance, not distance1. distance is the input and you need to use the input to pass all test cases.
var distance = parseInt(readLine(), 10) is the input. It is already given, use it instead of distance1
var distance = 590; var speed =40; var time1= (distance / speed )*60; console.log(time1);
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.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message