+ 3

Javascript

Which century? The editor is empty? https://www.sololearn.com/post/1773448/?ref=app

30th Oct 2024, 1:04 PM
You
You - avatar
16 odpowiedzi
+ 6
The code coach seems broken for me. I already completed this some time ago and it has a green checkmark on it, but when I ran it today, everything is 'no output'. But my code is still there. Something is broken on Sololearn's end. The code without my solution: function main() { var year = parseInt(readLine(), 10) // output console.log(calcCent(year)); } // complete the code function calcCent(year){ // your code here }
31st Oct 2024, 2:19 AM
Bob_Li
Bob_Li - avatar
+ 10
You must write the code to 1) take the year as input from the console, 2) process it, and 3) output the century. Then press RUN to execute the tests and see the results. Code Coach supplies the input values to the console automatically.
30th Oct 2024, 1:57 PM
Brian
Brian - avatar
+ 3
do not call main() – this is handled by sololearn. you seem to use an old course. you can try to reset the code and see if the template code appears.
30th Oct 2024, 3:48 PM
Lisa
Lisa - avatar
+ 3
when you reset the course progress, the most recent course version should be loaded. if you do not plan to reset the course, try to reset the code.
30th Oct 2024, 3:58 PM
Lisa
Lisa - avatar
+ 3
i do not find this code project in my course version.
30th Oct 2024, 3:59 PM
Lisa
Lisa - avatar
+ 3
Okay, I found it! It's empty for me, too.
30th Oct 2024, 4:06 PM
Lisa
Lisa - avatar
+ 3
write to info@sololearn.com
30th Oct 2024, 7:57 PM
Lisa
Lisa - avatar
+ 3
doesn't help
30th Oct 2024, 8:11 PM
Lisa
Lisa - avatar
+ 2
Brian Lisa I would be grateful if you reset your code of this problem, just for checking the issue is only with me or ...
30th Oct 2024, 3:58 PM
You
You - avatar
+ 1
Brian function main(year) { var calcCent = Math.ceil(year / 100); console.log(calcCent); } var year = parseInt(readLine(), 10) main(year) This is my code but when I run it, it shows no output?
30th Oct 2024, 3:37 PM
You
You - avatar
+ 1
Lisa No, I have js intermediate.Old courses are removed
30th Oct 2024, 3:50 PM
You
You - avatar
+ 1
Brian Lisa In all previous practice codes, Sololearn itself define a variable to take input from user. Even after resetting the code, it's completely blank.
30th Oct 2024, 3:57 PM
You
You - avatar
+ 1
Lisa I reset the code, but still doesn't working.
30th Oct 2024, 4:00 PM
You
You - avatar
+ 1
Lisa In the lesson 'The math object'.
30th Oct 2024, 4:00 PM
You
You - avatar
+ 1
The code you wrote has a few minor issues. Try this: function calcCentury() { return Math.ceil(year / 100); } var year = parseInt(prompt(), 10) var century = calcCentury(year) console.log(century) Issue #1: You shouldn't name a function main(). Bad form. Give the function a purpose and name it accordingly. Issue #2: You used readLine(). That wasn't working. I used prompt() instead. That was your main issue for why it wasn't working.
30th Oct 2024, 8:10 PM
Jerry Hobby
Jerry Hobby - avatar
0
How to solve it now, when we try to take input from user using parseInt(readLine(), 10); Still it doesn't work.
30th Oct 2024, 4:09 PM
You
You - avatar