Thread: Java

    #1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2013
    Posts
    1
    Rep Power
    0

    Java


    JAVA PROGRAMMING HELP!!



    Create a single class called MyTriangles in a file named MyTriangles.java.

    The class should print out the following four triangles separately, one below the other.

    Use for loops to generate the patterns.

    All asterisks (*) should be printed by a single statement of the form
    System.out.print( * ); which causes the asterisks to print side by side.

    A statement of the form
    System.out.println( ); can be used to move to the next line.

    A statement of the form
    System.out.print( X );

    A statement of the form
    System.out.print( O ); can be used to display X & O characters for the last two patterns.



    *
    **
    ***
    ****
    *****
    ******
    *******
    ********
    *********
    **********

    **********
    *********
    ********
    *******
    ******
    *****
    ****
    ***
    **
    *

    XXXXXXXXXX
    OXXXXXXXXX
    OOXXXXXXXX
    OOOXXXXXXX
    OOOOXXXXXX
    OOOOOXXXXX
    OOOOOOXXXX
    OOOOOOOXXX
    OOOOOOOOXX
    OOOOOOOOOX
    OOOOOOOOOO

    OOOOOOOOOO
    OOOOOOOOOX
    OOOOOOOOXX
    OOOOOOOXXX
    OOOOOOXXXX
    OOOOOXXXXX
    OOOOXXXXXX
    OOOXXXXXXX
    OOXXXXXXXX
    OXXXXXXXXX
    XXXXXXXXXX
  2. #2
  3. Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Aug 2010
    Location
    Eastern Florida
    Posts
    3,714
    Rep Power
    348

IMN logo majestic logo threadwatch logo seochat tools logo