Ex. 100

69 views
Skip to first unread message

rachitg...@gmail.com

unread,
Dec 5, 2015, 2:26:11 AM12/5/15
to mooc.fi
Hi,

I'm having problems with week exercise 100.

I can't get my instance variable starsInLastPrint to reset. Everytime I try to print the number of stars, the variable keeps adding to itself.


Best regards
Bob


Supported languages are English and Finnish

Please use our build in TMC Pastebin when asking questions related to your code  
 
TMC Plugin has built-in code sharing feature. 
In NetBeans, select TMC -> Send code to TMC pastebin. Copy the link you receive and paste it to your message.  

You may use our web interface to share code snippets: http://paste.mooc.fi

rachitg...@gmail.com

unread,
Dec 5, 2015, 2:29:33 AM12/5/15
to mooc.fi, rachitg...@gmail.com
Never mind, figured it out.

Thanks though
Bob

cherryint...@gmail.com

unread,
Dec 10, 2015, 2:52:06 AM12/10/15
to mooc.fi, rachitg...@gmail.com
Hi,

I am having the same problem and tried google for an hour but still can't figure it out. Please, any advice?

BR,
Linh

rachitg...@gmail.com

unread,
Dec 10, 2015, 2:59:44 AM12/10/15
to mooc.fi, rachitg...@gmail.com, cherryint...@gmail.com
So because you want your number of stars to reset after every complete Print(), you should reset the value of your variable counting the stars at the beginning of the Print method.

cherryint...@gmail.com

unread,
Dec 10, 2015, 3:15:10 AM12/10/15
to mooc.fi, rachitg...@gmail.com, cherryint...@gmail.com
Works now, thanks a lot for answering so quickly!
Reply all
Reply to author
Forward
0 new messages