jez1984
#1
At the top of this exercise on defining properties, the example Area is defined as an integer which is what you would expect i.e.
public int area;
public int Area
{
get { return area; }
set { area = value; }
}
However, further down it has become a string:
public string Area
{
get { return area; }
set
{
if (value < 0) { area = 0; }
else { area = value; }
}
}
No explanation is given for this. Please help.
1 Like
mtrtmk
#2
Definitely seems to be a typo. It should be “public int Area” in the second snippet as well.
1 Like
Good eye, @jez1984.
Thanks for your verification as well, @mtrtmk. I’ve just reported the bug directly to the CC engineering team.
For reference here’s a screenshot of the bug:

and a link to the exercise.
1 Like
Thank you, @jez1984 & @mtrtmk, for reporting the issue. It has been corrected.
1 Like