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 Strings Combining Strings

Need help with this Quiz

Hi this quiz was confusing i dont understand. I have watched the videos many times, so i gave up I need help.

Program.cs
using System;

class Program
{

    // YOUR CODE HERE: Define an Eat method!
    static string Eat(string foodone, string foodtwo)
    {

    }
    static void Main(string[] args)
    {

        Console.WriteLine($"think" {foodone} "and" {foodtwo} "are tasty!");

        Console.WriteLine(foodone("apples", "blueberries"));
        Console.WriteLine(foodone("carrots", "daikon"));
    }

}

2 Answers

Steven Parker
Steven Parker
231,269 Points

You have the right idea, but:

  • the code that builds the sentence needs to be inside the new method (don't change "Main")
  • the method should return the string instead of writing it out
  • the sentence should start with the word "I"

Here's what worked for me:

in the new method

static string Eat (string One, string Two)

{ return ($"I think {One} and {Two} are tasty!"); }