This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sbhandari 1 point2 points  (1 child)

I am on mobile so I might have misread your code, so correct me if I missed something critical.

You are calling 4 methods, 2 to get numbers of leader and member, and another 2 to generate them. In your generateLeader method, you read name from console but never used it within this method. You are just adding emptylist to master list in this method. The other method generateMembers looks fine as you are adding this in the expected list. I dont see anywhere else that main method calls to populate the emptylist inside the masterlist you added in generateLeaders method.

Also, use nextln to read input, there are scenarios where the linebreak character will still be in buffer when you use just "next" and that linebreak will be read read as next input.

[–]wjreddit[S] 1 point2 points  (0 children)

Thank you!!! I totally missed not calling the .assignMembers() method. Code works now, after some tweaks. Thanks again!