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

Rasmus Hall
Rasmus Hall
1,260 Points

Compiling error CS1001

i wrote it like he told me to do

using System; namespace.treehouse{ class Program { static void Main() {

    Console.Write("Skriv hvor mange minutter du har arbejdet: ");

    string tid = Console.ReadLine() + tid;

    Console.Writeline("du har motioneret " + tid + " Minutter!");

  }

} }

and yet it says

Program.cs(2,9): error CS1001: Unexpected symbol `.', expecting identifier

1 Answer

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there, Rasmus! You're close, but not quite there. There are currently two problems in your code that I can see and one is simply a spelling error.

You wrote this:

string tid = Console.ReadLine() + tid;

This will result in a syntax error as the + tid is not needed. You should erase the + tid from that line.

When you fix that, you will be presented with yet another syntax error and this is regarding the spelling/capitalization of WriteLine vs Writeline.

You wrote:

Console.Writeline("du har motioneret " + tid + " Minutter!");

But that should be:

// Note the capitalization of the "L"
Console.WriteLine("du har motioneret " + tid + " Minutter!");

Give it a shot after you've corrected these small issues! :sparkles:

Rasmus Hall
Rasmus Hall
1,260 Points

thank you so much!