Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Help with ASCII star shape

  1. #1
    Junior Member mprovinmeggan's Avatar
    Join Date
    Feb 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Help with ASCII star shape



    I am having an awful time submitting the right program for this star pattern. Any help will be appreciated. This is the only one I am having trouble with.

    2.4: Star Pattern
    Write a program that displays the following pattern:


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

    Help please! Can someone write this correctly for me?
    I input the following:

    // Program Challenge 2.4
    2
    3 public class PC24
    4 {
    5 public static void main(String[ ] args)
    6
    7 /** \n Newline Advances the cursor to the next line for subsequent printing p.42*/
    8
    9 {
    10
    11 System.out.println(" *\n"+ " ***\n"+" *****\n"+"*******\n"+ " *****\n");
    12
    13
    14 }
    15 }


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default re: Help with ASCII star shape

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for newcomers.

    Please give your threads useful titles.

  3. #3
    Member Ganeprog's Avatar
    Join Date
    Jan 2014
    Location
    Chennai,India
    Posts
    80
    My Mood
    Love
    Thanks
    3
    Thanked 6 Times in 6 Posts

    Default Re: Help with ASCII star shape

    Hi,

    Better you can use for loops it will help to achieve your requirement.

    If any difficulties post here. Happy to help you.

    Thanks,

Similar Threads

  1. Star Loop
    By poldz123 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 27th, 2012, 03:00 PM
  2. Drawing a Star of David
    By tryingtolearn in forum AWT / Java Swing
    Replies: 2
    Last Post: July 31st, 2012, 07:01 PM
  3. star design programs
    By prasansani in forum Java Theory & Questions
    Replies: 6
    Last Post: September 20th, 2011, 12:42 PM
  4. A Star Pathfinding algorithm optimization
    By randomcracker in forum Algorithms & Recursion
    Replies: 4
    Last Post: May 18th, 2011, 11:11 PM