I’m missing something here | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I’m missing something here

function main() { var seconds = parseInt(readLine(), 10) // Your code here var seconds= i =0 while (i<=4) document.write(i<=4; <br/>) }

19th Sep 2022, 10:34 PM
Emmanuel Pena
20 Answers
+ 1
I'll put in comments. I think that some of these codes you need to reread and learn from again. function main() { var seconds = parseInt(readLine(), 10) /* the "var seconds" is a variable that allows the user/system to have an input */ // Your code here var seconds= i =0 /* Here you have changed the variable "var seconds" and you shouldn't (you have also done it incorrectly) */ while (i<=4) document.write(i<=4; <br/>) /* you are using a while loop but you don't have anything that will make the while condition "false", so it will repeat forever. */ } Please, read the lessons again. Pay attention to the code examples they have - write them down exactly as they have them. Re-write them into the code playground. If it doesn't work, look back at your written notes and check your code.
20th Sep 2022, 5:29 AM
Ausgrindtube
Ausgrindtube - avatar
+ 1
function main() { var seconds = parseInt(readLine(), 10) // Your code here while( seconds >= 0 ) { console.log(seconds) ; // print scconds--; //decrement seconds } } // this is what I mean. Already posted. try it
20th Sep 2022, 7:29 PM
Jayakrishna 🇮🇳
+ 1
Sorry about that thank you for helping me really appreciate it
21st Sep 2022, 12:54 AM
Emmanuel Pena
+ 1
Hi Ryzell Mae Malabanan please create your own post for your problem. When you do it, add your text to the description and attach your code from the code playground. That way, someone can find your error and help you with it.
21st Sep 2022, 9:42 AM
Ausgrindtube
Ausgrindtube - avatar
0
Write a program-timer, that will take the count of seconds as input and output to the console all the seconds until timer stops. Sample Input 4 Sample Output 4 3 2 1 0
19th Sep 2022, 10:35 PM
Emmanuel Pena
0
It says im missing ) somewhere
19th Sep 2022, 11:11 PM
Emmanuel Pena
0
variable I needs to be incremented in the while loop
20th Sep 2022, 3:40 AM
Ifeanyichukwu Otiwa
0
Give me the answer ill figure it the
20th Sep 2022, 2:35 PM
Emmanuel Pena
0
Then
20th Sep 2022, 2:35 PM
Emmanuel Pena
0
function main() { var seconds = parseInt(readLine(), 10) // Your code here var i=0 while (i<=4){ console.log (seconds; i <=4) }
20th Sep 2022, 3:24 PM
Emmanuel Pena
0
while( seconds >= 0 ) { console.log(seconds) ; scconds--; // decrement seconds } // you don't need i then. If you want use i instead of seconds by using var i=seconds;
20th Sep 2022, 4:05 PM
Jayakrishna 🇮🇳
0
var i = seconds while (seconds <=0){ console.log (i<=4;) seconds--;
20th Sep 2022, 4:58 PM
Emmanuel Pena
0
Emmanuel Pena Why you posted your last reply..? What your expectation by that? What are you looking for...?
20th Sep 2022, 5:52 PM
Jayakrishna 🇮🇳
0
I still didnt get it
20th Sep 2022, 6:05 PM
Emmanuel Pena
0
function main() { var seconds = parseInt(readLine(), 10) // Your code here var i = 0; while (i<=4){ document.write(i) }
20th Sep 2022, 6:18 PM
Emmanuel Pena
0
To count down 43210
20th Sep 2022, 6:19 PM
Emmanuel Pena
0
function main() { var seconds = parseInt(readLine(), 10) // Your code here var i = 0; while (i<=4) { document.write(i - "<br />");i++ } Tried this one too
20th Sep 2022, 6:23 PM
Emmanuel Pena
0
Thank u finally !!
20th Sep 2022, 8:18 PM
Emmanuel Pena
0
"Give me the answer ill figure it then" Emmanuel Pena The problem is, we have been giving you the answer and you are making the same mistakes.
20th Sep 2022, 8:50 PM
Ausgrindtube
Ausgrindtube - avatar
0
Create program Fare that computes discount of passenger. Use the given table: If code is not within the selection make all output zero. Use switch case on your solution. Sample input/output: Enter Discount for Ordinary Passenger: 0 Business class additional Fare for Ordinary Passenger: 1000.00 Enter Discount for Student Passenger: 5 Business class additional Fare for Student Passenger: 700.00 Enter Discount for Senior Citizen Passenger: 10 Business class additional Fare for Senior Citizen Passenger: 500.00 Enter fare: 8000.00 Passenger type [O,S,C]: C Travelling in business class [Y/N]: Y Discount: 800.00 pesos Business class charge: 500.00 pesos New fare: 7,700.00 pesos
21st Sep 2022, 3:48 AM
Ryzell Mae Malabanan
Ryzell Mae Malabanan - avatar