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 Final

Matthew Benham
Matthew Benham
823 Points

Prep steps

  1. Declare a string to read entry
  2. Parse the text to int
  3. If clause to write yay if number of times written is less than int value (entry<=bool) Continue
  4. Quit the loop once number of times written equals int value--else break

These are the steps I think are needed to complete the challenge, is there anything I am missing; or is my logic off on any of these steps ?

Program.cs
using System;

namespace Treehouse.CodeChallenges
{
    class Program
    {
        static void Main()
        {
            Console.Write("Enter the number of times to print \"Yay!\": ");

        }
    }
}

1 Answer

Steven Parker
Steven Parker
231,269 Points

It doesn't look like you've written any code yet.

The code above is what the challenge gives you to begin with. But it sounds like you've done a good job identifying the parts of the code to write - except for #3 you won't need an "if clause" .. but you will need a loop. Also you can't name a numeric variable "bool" because that's a reserved word for a different type.

So give it your best "good faith" attempt and ask again if you have any trouble, showing the code you've written.