Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTojo Alex
Courses Plus Student 13,331 PointsThis should provide more info
In this code challenge it does not provide enough information such us what type should the property syntax should be or ... I'm completely wrong with my code. If that is the outcome than could you tell me the places where I went wrong.
namespace Treehouse.CodeChallenges
{
public class Frog
{
private int _numFliesEaten;
public _numFliesEaten{get;set;}
}
}
1 Answer
Steven Parker
231,198 PointsWell, there are a few bits if information you can infer:
- the challenge asks you to convert, so you can assume the property will have the same type (int)
- because you are converting, you can also expect to remove the original field
- the challenge specifically indicates the name of the new property is "NumFliesEaten"
Fix those and you should have it.
Tojo Alex
Courses Plus Student 13,331 Pointsthanks Steven and Stephen (what a tongue twister for me)
Stephen Wall
Courses Plus Student 27,294 PointsStephen Wall
Courses Plus Student 27,294 PointsIt's asking you to convert what was provided to the auto property version. Properties naming convention is Upper Camel Case so it wants you to change it like so:
So you were very close, just need to remove one of them. Although I agree after going through the challenge the directions are a bit vague.