C# C# Basics (Retired) Perfect Wrap Up

Moritz Griesel
Moritz Griesel
7,309 Points

Bummer! Did you delete the Program class?

This question is concerning the following Code Challenge.

I've wrote the following Code which works totally fine in the workspace:

namespace Treehouse.CodeChallenges { class Test { static void Main() {

        System.Console.Write("Enter the number of times to print \"Yay!\": ");
        try
        {
              string entry = System.Console.ReadLine();
              int input = int.Parse(entry);
         while(true) 
         {


           if(input > 0)
             {
                  input = input - 1;
                  System.Console.Write("Yay!");
                  continue;
             }
           else if(input == 0)
           {
             break;
           }  
           else  
             {
                  System.Console.WriteLine("You must enter a positive number.");
                  break;
             }        
         } 
        }   
        catch(System.FormatException)
        {           
           System.Console.Write("You must enter a whole number.");


        }    
    }
}

}

But after every check I only receive: Bummer! "Did you delete the Program class?"

Can somebody help me?

1 Answer

Matthew Hill
Matthew Hill
7,798 Points

The code challenges can be quite picky sometimes. In your code above you've named your class Test instead of Program, if the challenge is built to validate a call to Program it might be missing your code out entirely. Matt