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 trialAnthony Correia
3,481 Pointscant figure it out
why is this code not compiling for the first objective?
class Program
{
static void Main()
{
// Prompt user for minutes exercised
System.Console.Write("Enter how many minutes you exercised: ");
System.Console.ReadLine();
string bookTitle;
// Add minutes exercised to total
// Display total minutes exercised to the screen
// Repeat until user quits
}
}
1 Answer
Jennifer Nordell
Treehouse TeacherHi there! You're putting in code that the challenge hasn't asked for, including the definition of a Class and a Main method. These are not required by the challenge nor asked for. Also, you've included two Console methods that aren't specified by the challenge instructions. The entirety of the code needed for the first step of the challenge is in there if you erase all the things not specified by the instructions.
Keep in mind that it's always best to not do anything a challenge doesn't explicitly ask for. Even if functional outside the challenge, it can cause the challenge to fail. These challenges are extremely strict and testing for very specific things.
Here's what it was looking for:
string bookTitle;
Good luck!