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# The Challenge

Ali Dahud
Ali Dahud
3,459 Points

I don't quite understand this

using System;

namespace Treehouse.PracticeSession
{
    class Program
    {
        static void Main()
        {

            Console.Write("Enter a thing: ");
            string thing = Console.ReadLine();

            // TODO Declare and assign a "thing" string variable.
            // Example: "movie", "book", "color", etc.

            Console.Write("What is your name: ");
            string name = Console.ReadLine();
            // TODO Prompt the user with the text "What is your name?" 
            // and assign their value to a "name" string variable.

            Console.Write("what is your favorite? " + thing " ");
            string favoriteThing = Console.ReadLine();
            // TODO Prompt the user with the text 
            // "What is your favorite <thing>?" 
            // and assign their value to a "favoriteThing" string variable.
            Console.WriteLine(name + "'s favorite " + thing + " is: " + favoriteThing);
            // TODO Write the user's name and favorite thing to the console.
            // Example: "My name is James and my favorite movie is Toy Story."
        }
    }
}

here it says : on line (21,62) : error CS1525: Unexpected symbol ` '

why is that?

Would appreciate your help!

1 Answer

Steven Parker
Steven Parker
231,261 Points

It looks like you're missing an operator between thing and the quoted space " ".

I assume you intended to concatenate those with another "+":

            Console.Write("what is your favorite? " + thing + " ");
Ali Dahud
Ali Dahud
3,459 Points

I was quite sure I added it seems like I wasn’t looking at it. Or maybe I was too tired