Week 2 excercise 39.2 square.Bug

66 views
Skip to first unread message

mciecha...@gmail.com

unread,
Feb 20, 2017, 7:28:31 PM2/20/17
to mooc.fi
Hi,

I'm having problems with week 2 exercise 39.2  on course  Object-Oriented Programming with Java, part I
.

 There is: Create a method printSquare(int sideSize) that prints a square using our previous method printStars. 

Here is my code: 
http://paste.mooc.fi/db55f15d
I have a problem with test : Problem in printSquare(3). expected:<***[
***]***> but was:<***[******]***>

When in code I change to printStars(3);  the test says that the method printStars() have to be called 4 times. 
When I run program with printStart(4), and printSquare(4) it print me this:
****
****
****
****

So I think there is a bug in test, because when the method printSquare() is called third time with printStars(4) there should be 12 start, but the test will be passed only when there will be 9 start printed what is wrong I think.  

Best regards

thibautva...@gmail.com

unread,
Feb 21, 2017, 10:45:38 AM2/21/17
to mooc.fi, mciecha...@gmail.com
It seems that right now you have it set to always print arrays of 4 stars for your square, but what if i want
a square that is 5 *  5?
Op dinsdag 21 februari 2017 01:28:31 UTC+1 schreef mciecha...@gmail.com:
Reply all
Reply to author
Forward
0 new messages