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

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!