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 trial

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,799 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