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 trialSheron Fernando
344 PointsI cannot find the part of code to correct here
I cannot figure out what is wrong from the error description
Program.cs(22,37): warning CS0642: Possible mistaken empty statement
Program.cs(30,35): error CS1056: Unexpected character “'
Program.cs(30,48): error CS1644: Feature
type pattern matching' cannot be used because it is not part of the C# 6.0 language specification
Program.cs(30,53): error CS1525: Unexpected symbol input'
Program.cs(30,60): error CS1056: Unexpected character
”'
Program.cs(30,60): error CS1525: Unexpected symbol )'
Program.cs(34,12): error CS1525: Unexpected symbol
}', expecting `;'
Compilation failed: 6 error(s), 1 warnings
using System;
namespace Treehouse.CodeChallenges
{
class Program
{
static void Main()
{
Console.Write("Enter the number of times to print \"Yay!\": ");
string input = Console.ReadLine();
while (success = true)
{
bool success = int.TryParse(input, out int tempNum);
try
{
int count;
count = int.Parse(input);
int i = 0;
while (i < count);
{
i += 1;
Console.WriteLine("Yay!");
}
}
catch(FormatException)
{
Console.WriteLine(“That is not valid input.”);
}
continue
}
}
}
}
1 Answer
Emily Sullivan
13,598 PointsIn line 29:
Console.WriteLine(“That is not valid input.”);
the quotation marks are angled, as if you copied from a text document rather than typing it in.
Compare it to the quotation marks in line 24
Console.WriteLine("Yay!");