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 trial

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
231,269 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.