bug in exercise 95 Money class skeleton?

107 views
Skip to first unread message

Drayton Kittel

unread,
Mar 14, 2016, 4:33:23 PM3/14/16
to mooc.fi
I think there is a bug in the Money Class skeleton for exercise 95. 

 public String toString() {
        String zero = "";
        if (cents <= 10) {
            zero = "0";
        }

        return euros + "." + zero + cents + "e";
    }

I think it should read 

    if (cents< 10)...

other wise when cents = 10 it prints 010.

ljleppan

unread,
Mar 17, 2016, 5:29:08 AM3/17/16
to mooc.fi
Hi Drayton,

It seems that either someone on our end quietly fixed the issue or perhaps you edited your code accidentally. In either case, the template seems to be fixed now :)

If you run across any further situations like this, please do not hesitate to report them.

-Leo

Drayton Kittel

unread,
Mar 18, 2016, 9:52:07 AM3/18/16
to mooc.fi
I had to change the main function on Netbeans for it to pass all tests.

The mood.fi webpage for exercise 95 also still displays

If( cents <= 10 )

Instead of just <.

Glad to be of assistance. This is a great course.

Reply all
Reply to author
Forward
0 new messages