0
[Solved] Why the 'trip planner' and the 'snail in the well' examples had the same line of code at the beginning?
Hello, can someone explain to me why they had the line: parseInt(readLine(), 10); at the beginning? What does that line, and why both had the value of 10. I haven't seen that yet in JavaScript.
5 Answers
+ 2
Johanna here in the example the variable distance is getting a value for you. This part of code stay without changes. Your code will be tested with a few different numbers and then the result compared with a result of original code of Sololearn. You should write a solution for a requested task.
This is solutionâs example:
function main() {
var distance = parseInt(readLine(), 10);
//your code goes here
console.log(60*distance/40)
}
+ 2
Thanks! I didn't want to keep trying the other exercises without this info because I am not seeing parseInt yet in my course.
0
This data input for automatically test of a code. This will help you to understand it:
https://code.sololearn.com/WLqa7iV6A1uK/?ref=app
0
At the beginning they give user input as themselves will propose their test cases and you have to complete the code based in their input.
0
That code has a value stored in some place or 'reads' the text in the example?