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 trialChris Gauthier
Courses Plus Student 6,434 PointsC# Basics final challenge question
This won't compile, but in visual studio it does. I noticed other solutions were quite a bit more thorough than mine, but the challenge didn't ask for any validation or exception handling at all. Ive posted this message before, and have gotten some responses, but Im wondering why this won't work. Can someone help and maybe show me their solution so I can compare what Im doing wrong?
Thanks Chris
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
var input = Console.ReadLine();
var counter = Convert.ToInt32(input);
var count = 1;
while (count <= counter)
{
Console.Write("Yah!");
count++;
}
}
}
}
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! Your code is just fine thus far. It's your spelling that's a little off. They want you to print "Yay!", but you're printing "Yah!". If I change that "h" to a "y", your code passes the first step!
Note: these challenges are very exacting and generally require that the output match to the letter. This includes spelling, capitalization, punctuation, and even spacing.
Hope this helps!
Chris Gauthier
Courses Plus Student 6,434 PointsYeah that did the job! Those tricky details!! Thanks Jennifer.
Chris