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

Emily Sullivan
Emily Sullivan
13,598 Points

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