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 trialBenneth Paredis
4,597 PointsCant get the program working although i think my code is correct
Would somebody be so nice to check my code if it is correct, it is giving errors and i dont know why.
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
string input = Console.readLine();
int numberOfTimes = int.parse(input);
int counter = 0;
while (counter < numberOfTimes)
{
counter++;
Console.writeLine("Yay!");
}
}
}
}
2 Answers
Jennifer Nordell
Treehouse TeacherHi there! The problem with your code comes down to capitalization issues. Remember that C# is case-sensitive.
-
int.parse
should beint.Parse
-
readLine
should beReadLine
-
writeLine
should beWriteLine
Make these changes and give it another go! Good luck!
Benneth Paredis
4,597 PointsThank you very much i cant believe i missed such a small thing :D