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 trialLeo Ngai
2,184 PointsIt keeps on saying compile error. But I did changed the magic numbers. Help!
It keeps on saying compile error. But I did changed the magic numbers. Help!
private const int _midtier = 100000;
private const int _hightier = 150000;
private const string _redColor = "red";
private const string _yellowColor = "yellow";
private const string _greenColor = "green";
const int revenue = 125000;
string status = null;
if (revenue < _midtier)
{
status = _redColor;
}
else if (revenue < _hightier)
{
status = _yellowColor;
}
else
{
status = _greenColor;
}
1 Answer
Steven Parker
231,198 PointsWhenever you get a compile error, use the Preview button.
The preview will show you the actual output from the compiler, which can provide a helpful clue. In this case, it's a bunch of messages saying, "Unexpected symbol `private'"
An access modifier doesn't make sense here, so just remove the "private" from your constants and you should pass the challenge since you did change all the "magic numbers" as required.