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 trialSteven font
Courses Plus Student 927 PointsDoes this Challenge task need to be updated? When i check my work the reply shows a completely unrelated quote.
We called Quote("Patrick, I don't think wumbo is a real word."), but we got a return value of: 'Patrick, I don't think w
using System;
class Program
{
static string Quote (string phrase)
{
return phrase;
}
// YOUR CODE HERE: Define a Quote method!
static void Main(string[] args)
{
// Quote by Maya Angelou.
Console.WriteLine(Quote("\"When you learn, teach. When you get, give.\""));
// Quote by Benjamin Franklin.
Console.WriteLine(Quote("\"No gains without pains.\""));
}
}
2 Answers
Barry Snowe
51,277 PointsWhen you return the string represented by the argument phrase
, you need to return it with the double quotes surrounding it. So your method needs to do something like return "\"" + phrase + "\""
. But I may not have the syntax exactly right, as I haven't done much with C# in recent months. The point being, however, you need to do something to get those double quotes into the picture.
Steven font
Courses Plus Student 927 PointsSteven font
Courses Plus Student 927 PointsI understand what the task is asking but the string returned when clicking on the 'check work' button is a completely different string than what we see in the exercise. The string used in the exercise is 'When you learn, teach. When you get, give.'
When i click on the check work button I receive an error message that refers to a completely different string. We called Quote("Patrick, I don't think wumbo is a real word."), but we got a return value of: 'Patrick, I don't think...