26th Jun 2021, 1:00 PM
Haral Raphel
Haral Raphel - avatar
3 Respostas
+ 1
You didn't take input properly. I suggest you review the input lesson again. You didn't declare numSticks before using. You didn't give data type to numToTake a data type before initialization. Missing one } at the end of the code.
26th Jun 2021, 3:42 PM
你知道規則,我也是
你知道規則,我也是 - avatar
0
You are not defined variables numSticks, numToTake, take , but using. So define it before using and assign needed values. ex: int numSticks = 10; And you are not defined Scanner object 'take'. First import Scanner class then create Scanner object. Then you can use that Scanner methods through that object. Hope you know, how to do this. Hope it helps....
26th Jun 2021, 1:06 PM
Jayakrishna 🇮🇳
0
*Add a Scanner to take inputs from the user. (Its good to do the input lessons) *Defined numSticks and numToTake variables before using them. (int numSticks;) *You assign the user's value to the numTotake but forgot to assign a value to numSticks. *You missed a curly bracket in the end.
26th Jun 2021, 4:54 PM
Jayaru Perera
Jayaru Perera - avatar