
Yusef Andrews
3,982 PointsWhen clicking preview for the code challenge I get a completely different result from what my code should display
I'm trying to pass the quote "When you learn, teach. When you get, give", but when I hit preview it brings up something
using System;
class Program
{
// YOUR CODE HERE: Define a Quote method!
static string Quote(string a)
{
return (a);
}
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."));
}
}
4 Answers

KRIS NIKOLAISEN
Pro Student 51,733 PointsThere is a note in the instructions:
(Note that the output is surrounded by quotes.)
You'll need to update your return statement:
return ('"' + a + '"');

KRIS NIKOLAISEN
Pro Student 51,733 PointsYes. A hint. That's what it was trying to do

KRIS NIKOLAISEN
Pro Student 51,733 PointsIf you look closely at it: 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 wumbo is a real word.'.
We were expecting
'"Patrick, I don't think wumbo is a real word."'.
you see the double quotes surrounding the expected.

Yusef Andrews
3,982 PointsSo in other words, its was trying to give me a hint correct? I understand now, although I was expecting a compiler error to research.
Yusef Andrews
3,982 PointsYusef Andrews
3,982 PointsThanks for this, but I was confused because the results wouldn't specify an error. It keep bringing up a totally separate quote saying something like "I don't think wumbo exist", which is nowhere in my code.