Hello,
I am at the end of my first C# programming class. I am working on some extra credit. Having problems with my loops. I am supposed to get output looking exactly like this:
Bark
Bark Meow
Bark Meow Bark
Bark Meow Bark Meow
Bark Meow Bark Meow Bark
Bark Meow Bark Meow Bark Meow
Bark Meow Bark Meow Bark Meow Bark
Bark Meow Bark Meow Bark Meow Bark Meow
Bark Meow Bark Meow Bark Meow Bark Meow Bark
Bark Meow Bark Meow Bark Meow Bark Meow Bark Meow
using loops and stringbuilder. Here is one version of many I have tried:
static void Main(string[] args)
{
//declare strings
string cat = "Meow ";
string dog = "Bark ";
int row;
int column;
StringBuilder catsNdogs = new StringBuilder();
for (row = 1; row <= 10; row++)
{
catsNdogs.Append(dog);
for (column = 1; column < row; column++)
catsNdogs.Append(cat);
Console.WriteLine(catsNdogs.ToString());
}
}
I have searched this site and google for help to no avail. Forgive any indiscretions, still very new at this. Thank you for the help!!!