0

Can someone give tips on how to go about this?

function main() { var depth = parseInt(readLine(), 10); //your code goes here } In the module 3 project of JavaScript, I have tried applying the principles gained from the lessons but there are still problems.

15th Mar 2022, 5:14 PM
Emma Bem
Emma Bem - avatar
16 Answers
+ 3
It's quite easy, thanks to help in explanation I got from friends. I recommend you do a lot of research and go over the lessons again. This might be helpful
16th Mar 2022, 4:46 PM
Emma Bem
Emma Bem - avatar
+ 1
Oh ok, please wait a while
15th Mar 2022, 5:23 PM
Emma Bem
Emma Bem - avatar
+ 1
I used the for loop function, but none of the test cases came out right
15th Mar 2022, 5:25 PM
Emma Bem
Emma Bem - avatar
+ 1
unction main() { var depth = parseInt(readLine(), 10); //your code goes here var x=0 var length=0 while(length<=depth) { length+=7 y++; if (length<=depth) { length-=2 } else{console.log(y) return y; } } This was what I did
15th Mar 2022, 5:37 PM
Emma Bem
Emma Bem - avatar
+ 1
Ok, thank you sir
15th Mar 2022, 5:48 PM
Emma Bem
Emma Bem - avatar
+ 1
Ok, I think I have to restart everything
15th Mar 2022, 5:50 PM
Emma Bem
Emma Bem - avatar
+ 1
Snail in the well It's 8n JavaScript
15th Mar 2022, 6:00 PM
Emma Bem
Emma Bem - avatar
+ 1
Thanks a lot
15th Mar 2022, 6:13 PM
Emma Bem
Emma Bem - avatar
0
I have the same problem :(
16th Mar 2022, 4:44 PM
Mohammad Elyas Qati
Mohammad Elyas Qati - avatar
0
you have first to understand the syntax of if statement and syntax of loops
17th Mar 2022, 11:15 AM
MFAUME MUSSA MFAUME
MFAUME MUSSA MFAUME - avatar
0
Can someone teach me how to use C Program?
17th Mar 2022, 1:23 PM
Kristel Shine Durano