CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Unhappy Need help for homework problem

    I need to write a code for my homework result should should look like this:

    ********************
    * empty spaces *
    * empty spaces **
    * empty spaces ***
    * empty spaces ****
    * *****
    * ******
    * *******
    all the way down to this
    ********************
    I wrote a "for loop" but with no help
    my result comes too
    ********************
    *
    **
    ***
    ****
    *****
    ******
    *******
    all the way down to this
    ********************
    I wrote another "for loop" but with no help
    my result comme to this

    *********************
    ********************
    *******************
    all the way to this
    *
    *********************
    Here is my source code
    using System;
    public class SquareWriteLine
    {
    public static void Main()
    {
    int column,height=20,width=20;
    Console.WriteLine("-- Begin Shaded Square ({0} x {1})",20,20);
    Console.Write("*"+"******************"+"*");

    for (int row=0;row<height;++row)

    {

    for (column=0; column<row; column++)


    Console.Write("*");
    Console.WriteLine();

    }



    Console.WriteLine("*"+"******************"+"*");
    Console.WriteLine("-- End Shaded Square ({0} x {1})",20,20);
    }
    }
    Any help will be appreciated!!!
    Bill
    Last edited by bnovice; September 19th, 2004 at 11:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured