Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics (Retired) Console I/O Formatting Output

Greg Patten
Greg Patten
243 Points

Console Error

After getting nowhere, I entered in the code provided below the video...

using System;

namespace Treehouse.FitnessFrog { class Program { static void Main() { // Prompt user for minutes exercised Console.Write("Enter how many minutes you exercised: "); string entry = Console.ReadLine();

        // Add minutes exercised to total 

        // Display total minutes exercised to the screen 
        Console.WriteLine("You've entered " + entry + " minutes.");

        // Repeat until user quits
    }
}

}

...and it provides these errors:

Program.cs(8,8): error CS0103: The name Console' does not exist in the current context Program.cs(10,23): error CS0103: The nameConsole' does not exist in the current context
Program.cs(15,6): error CS0103: The name `Console' does not exist in the current context

Please help

Greg

2 Answers

Steven Parker
Steven Parker
218,813 Points

It works for me.

I was able to compile and run this program without errors in the workspace.

If you're still having trouble, you might try using the snapshot function in the workspace and posting the link to it.

Greg, I understand being frustrated when learning. But the first thing you need is organization. Take a snapshot of the code your given and add your proposed code using comments. Explain what your doing and why. Just writing this down will very often surprise you with your answer. If you need help we can see what code your working on and what your thinking. Then we can help get you on the right track.