JavaScript Coding Project | Sololearn: Learn to code for FREE!

-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?

js

1/28/2022 7:14:18 PM

Suren Shahbekyan

14 Answers

New Answer

+3

People can help you much faster when you link your code and explain what you try to do!

+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

0

You need to use "distance" variable – do not hard code the input. Do not remove the given code

0

Did you solve this project? Please can you send me the solution?

0

I can help you to solve it yourself! Can you please show your code?

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 ); */ }

0

Use distance, not distance1. distance is the input and you need to use the input to pass all test cases.

0

How can I use inputs? Where can I see it?

0

var distance = parseInt(readLine(), 10) is the input. It is already given, use it instead of distance1

0

var distance = 590; var speed =40; var time1= (distance / speed )*60; console.log(time1);

0

0

Where is the second input?

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.

0

Thank you,😉