Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

C# C# Basics (Retired) Perfect Final

Sheron Fernando
Sheron Fernando
344 Points

I 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: Featuretype 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

Program.cs
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

In 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!");